summaryrefslogtreecommitdiff
path: root/src/resources/sdlimagehelper.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-07-11 00:12:28 +0300
committerAndrei Karas <akaras@inbox.ru>2015-07-11 00:12:28 +0300
commitee75580d40c5c444d184a6ecbeb99493ba42085a (patch)
tree2db8ff3378810b33c8713d8e4eda1511c36ccb06 /src/resources/sdlimagehelper.cpp
parent4fbb944f132eb886a6f5b350e5a14a4fe380aacf (diff)
downloadmv-ee75580d40c5c444d184a6ecbeb99493ba42085a.tar.gz
mv-ee75580d40c5c444d184a6ecbeb99493ba42085a.tar.bz2
mv-ee75580d40c5c444d184a6ecbeb99493ba42085a.tar.xz
mv-ee75580d40c5c444d184a6ecbeb99493ba42085a.zip
Add missing checks into resources.
Diffstat (limited to 'src/resources/sdlimagehelper.cpp')
-rw-r--r--src/resources/sdlimagehelper.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/resources/sdlimagehelper.cpp b/src/resources/sdlimagehelper.cpp
index 38939269f..e0018b868 100644
--- a/src/resources/sdlimagehelper.cpp
+++ b/src/resources/sdlimagehelper.cpp
@@ -71,6 +71,8 @@ Image *SDLImageHelper::load(SDL_RWops *const rw, Dye const &dye)
SDL_Surface *const surf = MSDL_ConvertSurface(
tmpImage, &rgba, SDL_SWSURFACE);
MSDL_FreeSurface(tmpImage);
+ if (!surf)
+ return nullptr;
uint32_t *pixels = static_cast<uint32_t *>(surf->pixels);
const int type = dye.getType();