summaryrefslogtreecommitdiff
path: root/tools/gbagfx
diff options
context:
space:
mode:
Diffstat (limited to 'tools/gbagfx')
-rw-r--r--tools/gbagfx/Makefile2
-rw-r--r--tools/gbagfx/jasc_pal.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/tools/gbagfx/Makefile b/tools/gbagfx/Makefile
index e7f089445..3eb7f0b22 100644
--- a/tools/gbagfx/Makefile
+++ b/tools/gbagfx/Makefile
@@ -1,6 +1,6 @@
CC = gcc
-CFLAGS = -Wall -Wextra -std=c11 -O2
+CFLAGS = -Wall -Wextra -std=c11 -O2 -DPNG_SKIP_SETJMP_CHECK
LIBS = -lz -lpng
diff --git a/tools/gbagfx/jasc_pal.c b/tools/gbagfx/jasc_pal.c
index 02b6ed915..d003b7649 100644
--- a/tools/gbagfx/jasc_pal.c
+++ b/tools/gbagfx/jasc_pal.c
@@ -13,7 +13,7 @@
// "0100\r\n" (version; seems to always be "0100")
// "<NUMBER_OF_COLORS>\r\n" (number of colors in decimal)
//
-// 16 or 256 times (depending on above line):
+// <NUMBER_OF_COLORS> times:
// "<RED> <GREEN> <BLUE>\r\n" (color entry)
//
// Each color component is a decimal number from 0 to 255.
@@ -82,8 +82,8 @@ void ReadJascPalette(char *path, struct Palette *palette)
if (!ParseNumber(line, NULL, 10, &palette->numColors))
FATAL_ERROR("Failed to parse number of colors.\n");
- if (palette->numColors != 16 && palette->numColors != 256)
- FATAL_ERROR("%d is an invalid number of colors. The number of colors must be 16 or 256.\n", palette->numColors);
+ if (palette->numColors < 1 || palette->numColors > 256)
+ FATAL_ERROR("%d is an invalid number of colors. The number of colors must be in the range [1, 256].\n", palette->numColors);
for (int i = 0; i < palette->numColors; i++) {
ReadJascPaletteLine(fp, line);