Merge pull request #237 from sanderd17/patch-1
Fix compilation on GCC 6
This commit is contained in:
commit
e965a668a3
@ -677,7 +677,7 @@ static Image * loadPNG(Stream & s)
|
|||||||
png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
|
png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
|
||||||
if (png_ptr == NULL) {
|
if (png_ptr == NULL) {
|
||||||
// nvDebug( "*** LoadPNG: Error allocating read buffer in file '%s'.\n", name );
|
// nvDebug( "*** LoadPNG: Error allocating read buffer in file '%s'.\n", name );
|
||||||
return false;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Allocate/initialize a memory block for the image information
|
// Allocate/initialize a memory block for the image information
|
||||||
@ -685,14 +685,14 @@ static Image * loadPNG(Stream & s)
|
|||||||
if (info_ptr == NULL) {
|
if (info_ptr == NULL) {
|
||||||
png_destroy_read_struct(&png_ptr, NULL, NULL);
|
png_destroy_read_struct(&png_ptr, NULL, NULL);
|
||||||
// nvDebug( "*** LoadPNG: Error allocating image information for '%s'.\n", name );
|
// nvDebug( "*** LoadPNG: Error allocating image information for '%s'.\n", name );
|
||||||
return false;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set up the error handling
|
// Set up the error handling
|
||||||
if (setjmp(png_jmpbuf(png_ptr))) {
|
if (setjmp(png_jmpbuf(png_ptr))) {
|
||||||
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
|
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
|
||||||
// nvDebug( "*** LoadPNG: Error reading png file '%s'.\n", name );
|
// nvDebug( "*** LoadPNG: Error reading png file '%s'.\n", name );
|
||||||
return false;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set up the I/O functions.
|
// Set up the I/O functions.
|
||||||
|
Loading…
Reference in New Issue
Block a user