Commit 3dc06b69 authored by Mans Rullgard's avatar Mans Rullgard

tiny_psnr: check for specified sample size less than 1

A zero or negative sample size is impossible and should be
reported as an error.
Signed-off-by: 's avatarMans Rullgard <mans@mansr.com>
parent 09929457
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment