shithub: libvpx

Download patch

ref: 7ef094c02f261f3599072eb1fa9aaa2477f9d47e
parent: 2e6a1976a0fd9bc1cfbae137876b397b1148037e
author: Jim Bankoski <[email protected]>
date: Mon Oct 24 08:05:59 EDT 2016

vpxdec: return fail if frame fails to decode.

A failure to decode is most likely equivalent to a corrupt
frame for the purpose of returning a failure.

Change-Id: Ie53db2b8130b40b725841f5f7a299d63aa56913d

--- a/vpxdec.c
+++ b/vpxdec.c
@@ -9,11 +9,11 @@
  */
 
 #include <assert.h>
+#include <limits.h>
+#include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <stdarg.h>
 #include <string.h>
-#include <limits.h>
 
 #include "./vpx_config.h"
 
@@ -780,8 +780,8 @@
           const char *detail = vpx_codec_error_detail(&decoder);
           warn("Failed to decode frame %d: %s", frame_in,
                vpx_codec_error(&decoder));
-
           if (detail) warn("Additional information: %s", detail);
+          frames_corrupted++;
           if (!keep_going) goto fail;
         }
 
@@ -800,6 +800,8 @@
       // Flush the decoder in frame parallel decode.
       if (vpx_codec_decode(&decoder, NULL, 0, NULL, 0)) {
         warn("Failed to flush decoder: %s", vpx_codec_error(&decoder));
+        frames_corrupted++;
+        if (!keep_going) goto fail;
       }
     }