comparison tools/libgfx.c @ 2019:e809e323fdde

Check for NULL pointer.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 25 Oct 2018 17:45:38 +0300
parents 7114ea4c3c42
children 57a2527ff63d
comparison
equal deleted inserted replaced
2018:1c45b2fb471d 2019:e809e323fdde
1865 if ((res = dmSkipIFFChunkRest(fp, &chunk)) != DMERR_OK) 1865 if ((res = dmSkipIFFChunkRest(fp, &chunk)) != DMERR_OK)
1866 return res; 1866 return res;
1867 } 1867 }
1868 1868
1869 // Check if we should have a palette 1869 // Check if we should have a palette
1870 if ((*pimg)->format == DM_COLFMT_PALETTE) 1870 if (*pimg != NULL && (*pimg)->format == DM_COLFMT_PALETTE)
1871 { 1871 {
1872 // Check that we DO have a palette .. 1872 // Check that we DO have a palette ..
1873 if (iff.pal == NULL || iff.ncolors == 0) 1873 if (iff.pal == NULL || iff.ncolors == 0)
1874 { 1874 {
1875 return dmError(DMERR_INVALID_DATA, 1875 return dmError(DMERR_INVALID_DATA,