From 7d8d337b2c47df88498067ff9091386691242144 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Furkan=20T=C3=BCrkal?= Date: Sat, 22 Jun 2019 15:52:51 +0300 Subject: fix some crashes --- core/image.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'core') 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::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::Write w = new_img.write(); -- cgit v1.2.3