diff --git a/core/image.cpp b/core/image.cpp index 58f49d69e6c..8cd2562bcbe 100644 --- a/core/image.cpp +++ b/core/image.cpp @@ -1161,6 +1161,9 @@ PoolVector Image::get_data() const { void Image::create(int p_width, int p_height, bool p_use_mipmaps, Format p_format) { + ERR_FAIL_INDEX(p_width - 1, MAX_WIDTH); + ERR_FAIL_INDEX(p_height - 1, MAX_HEIGHT); + int mm = 0; int size = _get_dst_image_size(p_width, p_height, p_format, mm, p_use_mipmaps ? -1 : 0); data.resize(size);