# HG changeset patch # User Matti Hamalainen # Date 1560481487 -10800 # Node ID 69e868af764cf58bf0b23d9cd55706146d713198 # Parent f8bba7a82ec29e214f6bb72b6de15cbb5a71ca32 Check for minimum number of colors in a external palette file. diff -r f8bba7a82ec2 -r 69e868af764c tools/gfxconv.c --- a/tools/gfxconv.c Fri Jun 14 06:04:15 2019 +0300 +++ b/tools/gfxconv.c Fri Jun 14 06:04:47 2019 +0300 @@ -2156,6 +2156,13 @@ { if ((res = dmHandleExternalPalette(optPaletteFile, &optC64Spec.pal)) != DMERR_OK) goto exit; + + if (optSpec.pal->ncolors < D64_NCOLORS) + { + dmErrorMsg("Palette does not have enough colors (%d < %d)\n", + optSpec.pal->ncolors, D64_NCOLORS); + goto exit; + } } else {