Bail out if surf is NULL

This commit is contained in:
simon.kagstrom 2010-02-06 07:37:00 +00:00
parent 4f076f72f2
commit 3983fbb7d2

View File

@ -200,6 +200,9 @@ void *sdl_surface_to_png(SDL_Surface *surf, size_t *out_sz)
png_colorp palette;
struct png_write_user_struct out;
if (!surf)
return NULL;
out.sz = 0;
out.data = NULL;