We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2098

Summary: Pointer variable not initialized in IMG_SavePNG_RW()
Product: SDL_image Reporter: manuel.montezelo
Component: miscAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: unspecified   
Hardware: All   
OS: All   

Description manuel.montezelo 2013-09-13 18:34:04 UTC
Hi,

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).

Hope that helps.
Comment 1 Sam Lantinga 2013-09-28 06:51:42 UTC
Good catch!  This is fixed, thanks:
http://hg.libsdl.org/SDL_image/rev/00dd129031a1