diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-07-11 00:12:28 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-07-11 00:12:28 +0300 |
commit | ee75580d40c5c444d184a6ecbeb99493ba42085a (patch) | |
tree | 2db8ff3378810b33c8713d8e4eda1511c36ccb06 /src/resources/imagehelper.cpp | |
parent | 4fbb944f132eb886a6f5b350e5a14a4fe380aacf (diff) | |
download | manaplus-ee75580d40c5c444d184a6ecbeb99493ba42085a.tar.gz manaplus-ee75580d40c5c444d184a6ecbeb99493ba42085a.tar.bz2 manaplus-ee75580d40c5c444d184a6ecbeb99493ba42085a.tar.xz manaplus-ee75580d40c5c444d184a6ecbeb99493ba42085a.zip |
Add missing checks into resources.
Diffstat (limited to 'src/resources/imagehelper.cpp')
-rw-r--r-- | src/resources/imagehelper.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/resources/imagehelper.cpp b/src/resources/imagehelper.cpp index e49a738f2..18e415972 100644 --- a/src/resources/imagehelper.cpp +++ b/src/resources/imagehelper.cpp @@ -86,6 +86,9 @@ Image *ImageHelper::load(SDL_RWops *const rw, Dye const &dye) tmpImage, &rgba, SDL_SWSURFACE); MSDL_FreeSurface(tmpImage); + if (!surf) + return nullptr; + uint32_t *const pixels = static_cast<uint32_t *const>(surf->pixels); const int type = dye.getType(); |