diff options
author | Furkan Türkal <furkan.turkal@hotmail.com> | 2019-06-22 15:52:51 +0300 |
---|---|---|
committer | Furkan Türkal <furkan.turkal@hotmail.com> | 2019-07-01 14:28:29 +0300 |
commit | 7d8d337b2c47df88498067ff9091386691242144 (patch) | |
tree | 50dc0cb8fa683586cc947a2994fe48b45bba91b8 /core/image.cpp | |
parent | 30383a1cdc00d398349515b81a85fa1d3da7ae37 (diff) | |
download | redot-engine-7d8d337b2c47df88498067ff9091386691242144.tar.gz |
fix some crashes
Diffstat (limited to 'core/image.cpp')
-rw-r--r-- | core/image.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/core/image.cpp b/core/image.cpp index c85d7f6bcc..4910d06738 100644 --- a/core/image.cpp +++ b/core/image.cpp @@ -1372,6 +1372,7 @@ void Image::shrink_x2() { int new_size = data.size() - ofs; new_img.resize(new_size); + ERR_FAIL_COND(new_img.size() == 0); { PoolVector<uint8_t>::Write w = new_img.write(); @@ -1391,6 +1392,7 @@ void Image::shrink_x2() { ERR_FAIL_COND(!_can_modify(format)); int ps = get_format_pixel_size(format); new_img.resize((width / 2) * (height / 2) * ps); + ERR_FAIL_COND(new_img.size() == 0); { PoolVector<uint8_t>::Write w = new_img.write(); |