Crash prevention

This commit is contained in:
Jaime Passos 2019-09-11 20:38:15 -03:00
parent a5ff609873
commit e3df9cc6b1
1 changed files with 1 additions and 1 deletions

View File

@ -2744,7 +2744,7 @@ static png_bytep *PNG_Read(UINT8 *png, UINT16 *w, UINT16 *h, INT16 *topoffset, I
png_read_image(png_ptr, row_pointers);
// Read grAB chunk
if (topoffset || leftoffset)
if ((topoffset || leftoffset) && (chunk.data != NULL))
{
INT32 *offsets = (INT32 *)chunk.data;