From c62ce03679b4eee6a769f0200696ba18a110d734 Mon Sep 17 00:00:00 2001 From: Marcel Schneider Date: Wed, 5 Aug 2020 20:55:31 +0200 Subject: [PATCH] Make sure that a new image can only be created when the buffer is not currently locked --- core/image.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/core/image.cpp b/core/image.cpp index 10b678d6903..8cb95a8df80 100644 --- a/core/image.cpp +++ b/core/image.cpp @@ -1586,6 +1586,7 @@ void Image::create(int p_width, int p_height, bool p_use_mipmaps, Format p_forma ERR_FAIL_COND_MSG(p_height <= 0, "Image height must be greater than 0."); ERR_FAIL_COND_MSG(p_width > MAX_WIDTH, "Image width cannot be greater than " + itos(MAX_WIDTH) + "."); ERR_FAIL_COND_MSG(p_height > MAX_HEIGHT, "Image height cannot be greater than " + itos(MAX_HEIGHT) + "."); + ERR_FAIL_COND_MSG(write_lock.ptr(), "Cannot create image when it is locked."); int mm = 0; int size = _get_dst_image_size(p_width, p_height, p_format, mm, p_use_mipmaps ? -1 : 0);