Imported from libpng-1.0.7beta18.tar

This commit is contained in:
Glenn Randers-Pehrson
2000-06-24 07:42:42 -05:00
parent 1f2d559f70
commit 1394480f4b
52 changed files with 207 additions and 192 deletions

View File

@@ -228,9 +228,7 @@ BOOL PngLoadImage (PTSTR pstrFileName, png_byte **ppbImageData,
if ((pbImageData = (png_byte *) malloc(ulRowBytes * (*piHeight)
* sizeof(png_byte))) == NULL)
{
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
*ppbImageData = pbImageData = NULL;
return FALSE;
png_error(png_ptr, "Visual PNG: out of memory");
}
*ppbImageData = pbImageData;
@@ -239,10 +237,7 @@ BOOL PngLoadImage (PTSTR pstrFileName, png_byte **ppbImageData,
if ((ppbRowPointers = (png_bytepp) malloc((*piHeight)
* sizeof(png_bytep))) == NULL)
{
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
free(pbImageData);
*ppbImageData = pbImageData = NULL;
return FALSE;
png_error(png_ptr, "Visual PNG: out of memory");
}
// set the individual row-pointers to point at the correct offsets
@@ -269,6 +264,7 @@ BOOL PngLoadImage (PTSTR pstrFileName, png_byte **ppbImageData,
Catch (msg)
{
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
*ppbImageData = pbImageData = NULL;
if(ppbRowPointers)