Skip to content

Commit aed2c72

Browse files
author
sbird
committed
fix(tools): gbagfx potential oob read
1 parent e22b799 commit aed2c72

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tools/gbagfx/main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,8 @@ void HandleJascToGbaPaletteCommand(char *inputPath, char *outputPath, int argc,
333333

334334
if (numColors < 1)
335335
FATAL_ERROR("Number of colors must be positive.\n");
336+
if (numColors > 256)
337+
FATAL_ERROR("Number of colors must be less than 256.\n");
336338
}
337339
else
338340
{

0 commit comments

Comments
 (0)