shithub: libvpx

Download patch

ref: 52a39f75f25e3c596b39ceff4d07c22c58d90c18
parent: ff1083c11343da3e87602c3940afa523abd7266a
author: Yaowu Xu <yaowu@google.com>
date: Tue Oct 15 07:05:06 EDT 2013

Added trap for invalid key frame

Change-Id: I698e8df9b336d38bffe01e656acba00d4003695f

--- a/vp9/decoder/vp9_decodframe.c
+++ b/vp9/decoder/vp9_decodframe.c
@@ -955,9 +955,15 @@
   YV12_BUFFER_CONFIG *new_fb = &cm->yv12_fb[cm->new_fb_idx];
 
   if (!first_partition_size) {
-    // showing a frame directly
-    *p_data_end = data + 1;
-    return 0;
+    if (!keyframe) {
+      // showing a frame directly
+      *p_data_end = data + 1;
+      return 0;
+    } else {
+      vpx_internal_error(&cm->error, VPX_CODEC_CORRUPT_FRAME,
+                         "Invalid key frame");
+      return -1;
+    }
   }
   data += vp9_rb_bytes_read(&rb);
   xd->corrupted = 0;