Patch -palIndex option check

This commit is contained in:
Rachel 2023-09-09 01:27:39 -07:00 committed by GitHub
parent b660c02db6
commit ac83b43fca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

2
main.c
View File

@ -288,7 +288,7 @@ void HandleNtrToPngCommand(char *inputPath, char *outputPath, int argc, char **a
if (!ParseNumber(argv[i], NULL, 10, &options.palIndex)) if (!ParseNumber(argv[i], NULL, 10, &options.palIndex))
FATAL_ERROR("Failed to parse palette index.\n"); FATAL_ERROR("Failed to parse palette index.\n");
if (options.width < 1) if (options.palIndex < 1)
FATAL_ERROR("Palette index must be positive.\n"); FATAL_ERROR("Palette index must be positive.\n");
} }
else if (strcmp(option, "-width") == 0) else if (strcmp(option, "-width") == 0)