diff options
author | yenatch <yenatch@gmail.com> | 2016-06-18 21:44:41 -0400 |
---|---|---|
committer | yenatch <yenatch@gmail.com> | 2016-06-18 21:44:41 -0400 |
commit | 9d069cf3d6826582df588841231c9f27db54e669 (patch) | |
tree | 1f71d1898be0e61a5eea61ec90836e06a5071b1a /tools/gbagfx | |
parent | 5ce142208ec376c237753473b59ec0d35272e8fd (diff) | |
parent | 32906c6d209005c7fe912d743a5bb8b8847d0c75 (diff) |
Merge remote-tracking branch 'origin/master'
Conflicts:
Makefile
Diffstat (limited to 'tools/gbagfx')
-rw-r--r-- | tools/gbagfx/Makefile | 2 | ||||
-rw-r--r-- | tools/gbagfx/jasc_pal.c | 6 |
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); |