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 AUERandsbird authored and GitHub committed 2025-07-21 18:33:44 +01:00
1 parent e22b799d7f
commit e63e89e270
1 file changed
+3
+3
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
{ {