[libav-commits] tiny_psnr: check for specified sample size less than 1

Mans Rullgard git at libav.org
Mon Oct 15 22:49:32 CEST 2012


Module: libav
Branch: master
Commit: 3dc06b6972cf389269e9c36ff0a4373f80f7149b

Author:    Mans Rullgard <mans at mansr.com>
Committer: Mans Rullgard <mans at mansr.com>
Date:      Mon Oct 15 00:11:44 2012 +0100

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 at mansr.com>

---

 tests/tiny_psnr.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tests/tiny_psnr.c b/tests/tiny_psnr.c
index 5db2662..a53a670 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;
             }



More information about the libav-commits mailing list