# HG changeset patch # User Matti Hamalainen # Date 1560479720 -10800 # Node ID fa5e74384d87189d1dc7ded418c5d58f82bc1d6f # Parent 7a0af15fbe9781093e7e287e6fdb975c2da0239e Check for non-existing palette when reading palette from image file. diff -r 7a0af15fbe97 -r fa5e74384d87 tools/lib64util.c --- a/tools/lib64util.c Fri Jun 14 05:32:58 2019 +0300 +++ b/tools/lib64util.c Fri Jun 14 05:35:20 2019 +0300 @@ -170,7 +170,13 @@ goto done; } - res = dmPaletteCopy(ppal, inImage->pal); + if (inImage->pal != NULL) + res = dmPaletteCopy(ppal, inImage->pal); + else + { + dmErrorMsg("Image file does not have a palette.\n"); + res = DMERR_NULLPTR; + } } else if (dmPaletteProbeGeneric(dataBuf, dataSize, &pfmt, &index) > 0 &&