Imported from libpng-1.0.7rc1.tar

This commit is contained in:
Glenn Randers-Pehrson
2000-06-09 08:46:21 -05:00
parent db66d44801
commit 1f2d559f70
52 changed files with 190 additions and 202 deletions

View File

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