From 7ee1d89a656c05b62fa3104b59504afed0037b69 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 25 Jun 2015 22:31:50 +0300 Subject: Add missing checks into db directory. --- src/utils/sdlpixel.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/utils/sdlpixel.h') diff --git a/src/utils/sdlpixel.h b/src/utils/sdlpixel.h index 4fb7cd774..6e78c184b 100644 --- a/src/utils/sdlpixel.h +++ b/src/utils/sdlpixel.h @@ -145,6 +145,11 @@ inline unsigned int SDLAlpha32(const unsigned int src, return (b & 0xff) | (g & 0xff00) | (r & 0xff0000); } +inline unsigned short SDLAlpha16(const unsigned short src, + const unsigned short dst, + const unsigned char a, + const SDL_PixelFormat *const f) A_NONNULL(4); + /** * Blends two 16 bit colors together. * @@ -178,6 +183,8 @@ inline unsigned short SDLAlpha16(const unsigned short src, inline void SDLputPixelAlpha(SDL_Surface* surface, int x, int y, const Color& color) { + if (!surface) + return; const int bpp = surface->format->BytesPerPixel; SDL_LockSurface(surface); -- cgit v1.2.3-70-g09d2