shithub: libvpx

Download patch

ref: 86ef5a0689da9a9e71ff424d52976ca09c128d9c
parent: a8bbe7d808464f8187f3b61efdca690c2977cd55
parent: 156de9c3ef96a9c68048760a5b7b9d35a9ce904e
author: Dmitry Kovalev <dkovalev@google.com>
date: Tue Oct 29 08:10:43 EDT 2013

Merge "Correct handling of show_bit in uncompressed header."

--- a/vp9/decoder/vp9_decodframe.c
+++ b/vp9/decoder/vp9_decodframe.c
@@ -1041,7 +1041,11 @@
   setup_tile_info(cm, rb);
   sz = vp9_rb_read_literal(rb, 16);
 
-  return sz > 0 ? sz : -1;
+  if (sz == 0)
+    vpx_internal_error(&cm->error, VPX_CODEC_CORRUPT_FRAME,
+                       "Invalid header size");
+
+  return sz;
 }
 
 static int read_compressed_header(VP9D_COMP *pbi, const uint8_t *data,
@@ -1157,15 +1161,9 @@
   YV12_BUFFER_CONFIG *const new_fb = get_frame_new_buffer(cm);
 
   if (!first_partition_size) {
-    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;
-    }
   }
 
   if (!pbi->decoded_key_frame && !keyframe)