Fix potential stack memory leak in gbagfx due to out of bounds read (#2162)

* fix(tools): gbagfx potential oob read

---------

Co-authored-by: sbird <sbird@no.tld>
This commit is contained in:
Philipp AUER
2025-07-21 19:33:44 +02:00
committed by GitHub
parent e22b799d7f
commit e63e89e270

View File

@@ -333,6 +333,9 @@ void HandleJascToGbaPaletteCommand(char *inputPath, char *outputPath, int argc,
if (numColors < 1) if (numColors < 1)
FATAL_ERROR("Number of colors must be positive.\n"); FATAL_ERROR("Number of colors must be positive.\n");
if (numColors > 255)
FATAL_ERROR("Number of colors must be less than 256.\n");
} }
else else
{ {