A zero or negative sample size is impossible and should be
reported as an error.

Signed-off-by: Mans Rullgard <m...@mansr.com>
---
 tests/tiny_psnr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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

_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to