Merge pull request #18629 from raphael10241024/patch2

Fix : add condition check in Imgae::create(...), #18592
This commit is contained in:
Max Hilbrunner 2018-05-05 17:14:49 +02:00 committed by GitHub
commit c9f5288b67
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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