From 5e60c15b1dc1b4e08d86f1d28f57fab1e990757e Mon Sep 17 00:00:00 2001 From: Clownacy Date: Sun, 26 Jan 2020 23:53:40 +0000 Subject: [PATCH] Add missing sanity check --- src/Draw.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Draw.cpp b/src/Draw.cpp index 79c23f38..5b5c59f7 100644 --- a/src/Draw.cpp +++ b/src/Draw.cpp @@ -334,6 +334,9 @@ BOOL ReloadBitmap_Resource(const char *name, SurfaceID surf_no) size_t size; const unsigned char *data = FindResource(name, "BITMAP", &size); + if (data == NULL) + return FALSE; + int width, height; unsigned char *image_buffer = DecodeBitmap(data, size, &width, &height);