Browse Source

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: Mans Rullgard <mans@mansr.com>
tags/n1.1
Mans Rullgard 12 years ago
parent
commit
3dc06b6972
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      tests/tiny_psnr.c

+ 1
- 1
tests/tiny_psnr.c View File

@@ -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;
}


Loading…
Cancel
Save