diff options
author | Max Hilbrunner <mhilbrunner@users.noreply.github.com> | 2018-05-05 17:14:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-05 17:14:49 +0200 |
commit | c9f5288b671ea7dda8a07e9834058438ebe8bbc4 (patch) | |
tree | 1c8b98a4e2ad8c3c58cafa2400be276b38892d96 /core | |
parent | fc9fad925b7e406729748660d9079011cb40a96b (diff) | |
parent | 63e258cc8fa653a66b6020d091abce3fad8e9db7 (diff) |
Merge pull request #18629 from raphael10241024/patch2
Fix : add condition check in Imgae::create(...), #18592
Diffstat (limited to 'core')
-rw-r--r-- | core/image.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/core/image.cpp b/core/image.cpp index 58f49d69e6..8cd2562bcb 100644 --- a/core/image.cpp +++ b/core/image.cpp @@ -1161,6 +1161,9 @@ PoolVector<uint8_t> 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); |