Skip to content

Commit

Permalink
Fixed bug 2098 - Pointer variable not initialized in IMG_SavePNG_RW()
Browse files Browse the repository at this point in the history
manuel.montezelo

In line 618 of http://hg.libsdl.org/SDL_image/file/361ab0371a02/IMG_png.c
  void *png;

it's not initialized to =NULL, and possibly can be used without being initialized (or otherwise, the nearby check "if (png)" doesn't make much sense, I think).
  • Loading branch information
slouken committed Sep 28, 2013
1 parent f7fd61b commit 4ff5dd5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion IMG_png.c
Expand Up @@ -615,7 +615,7 @@ int IMG_SavePNG_RW(SDL_Surface *surface, SDL_RWops *dst, int freedst)
static const Uint32 png_format = SDL_PIXELFORMAT_RGBA8888;
#endif
size_t size;
void *png;
void *png = NULL;

if (surface->format->format == png_format) {
png = tdefl_write_image_to_png_file_in_memory(surface->pixels, surface->w, surface->h, surface->pitch, surface->format->BytesPerPixel, &size);
Expand Down

0 comments on commit 4ff5dd5

Please sign in to comment.