comparison tools/gfxconv.c @ 2215:69e868af764c

Check for minimum number of colors in a external palette file.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 14 Jun 2019 06:04:47 +0300
parents f8bba7a82ec2
children 2fa3458b364d
comparison
equal deleted inserted replaced
2214:f8bba7a82ec2 2215:69e868af764c
2154 2154
2155 if (optPaletteFile != NULL) 2155 if (optPaletteFile != NULL)
2156 { 2156 {
2157 if ((res = dmHandleExternalPalette(optPaletteFile, &optC64Spec.pal)) != DMERR_OK) 2157 if ((res = dmHandleExternalPalette(optPaletteFile, &optC64Spec.pal)) != DMERR_OK)
2158 goto exit; 2158 goto exit;
2159
2160 if (optSpec.pal->ncolors < D64_NCOLORS)
2161 {
2162 dmErrorMsg("Palette does not have enough colors (%d < %d)\n",
2163 optSpec.pal->ncolors, D64_NCOLORS);
2164 goto exit;
2165 }
2159 } 2166 }
2160 else 2167 else
2161 { 2168 {
2162 // No palette file specified, use internal palette 2169 // No palette file specified, use internal palette
2163 if (optC64Palette == NULL) 2170 if (optC64Palette == NULL)