]> granicus.if.org Git - libvpx/commitdiff
Correct handling of show_bit in uncompressed header.
authorDmitry Kovalev <dkovalev@google.com>
Tue, 29 Oct 2013 18:24:08 +0000 (11:24 -0700)
committerDmitry Kovalev <dkovalev@google.com>
Tue, 29 Oct 2013 18:24:08 +0000 (11:24 -0700)
"keyframe" variable in the current code actually means that previous
frame is a keyframe because cm->frame_type has not been initialized
in read_uncompressed_header.

Change-Id: I5645b0816c70abdef5dfc70113018d06276dac77

vp9/decoder/vp9_decodframe.c

index 40cab68e8b2ce92821c5db53447a36a391dbcced..29da4fe047049b6559e3e67f217773c8f12a0479 100644 (file)
@@ -1041,7 +1041,11 @@ static size_t read_uncompressed_header(VP9D_COMP *pbi,
   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 @@ int vp9_decode_frame(VP9D_COMP *pbi, const uint8_t **p_data_end) {
   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)