summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-07-01 14:59:29 +0200
committerGitHub <noreply@github.com>2019-07-01 14:59:29 +0200
commit6b30f284a0544972f761be3e92ad8d1b176c9f9f (patch)
tree5edd19124ce8c9265a869a8171541d5ff7c60e17 /core
parentb0ce9401ffa731cc346ab6762fd0794709634428 (diff)
parent7d8d337b2c47df88498067ff9091386691242144 (diff)
Merge pull request #29980 from Dentrax/directed-by-qarmin
Fix some editor crashes
Diffstat (limited to 'core')
-rw-r--r--core/image.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/core/image.cpp b/core/image.cpp
index 4da8f27e5f..18a3aae88f 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();