diff --git a/tests/tiny_psnr.c b/tests/tiny_psnr.c index 5db2662478..a53a67038b 100644 --- a/tests/tiny_psnr.c +++ b/tests/tiny_psnr.c @@ -139,7 +139,7 @@ int main(int argc, char *argv[]) } else { char *end; len = strtol(argv[3], &end, 0); - if (*end || len > 2) { + if (*end || len < 1 || len > 2) { fprintf(stderr, "Unsupported sample format: %s\n", argv[3]); return 1; }