mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
Added error to catch conversion on invalid image
(cherry picked from commit dec2269bca)
This commit is contained in:
@@ -509,6 +509,7 @@ static void _convert(int p_width, int p_height, const uint8_t *p_src, uint8_t *p
|
||||
}
|
||||
|
||||
void Image::convert(Format p_new_format) {
|
||||
ERR_FAIL_INDEX_MSG(p_new_format, FORMAT_MAX, "The Image format specified (" + itos(p_new_format) + ") is out of range. See Image's Format enum.");
|
||||
if (data.size() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user