Added error to catch conversion on invalid image

(cherry picked from commit dec2269bca)
This commit is contained in:
rsburke4
2023-11-11 22:17:56 -05:00
committed by Yuri Sizov
parent fe834981e1
commit 0224a60b43
2 changed files with 24 additions and 0 deletions

View File

@@ -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;
}