ref: 156de9c3ef96a9c68048760a5b7b9d35a9ce904e
parent: a8e31d624aa50c15d8bf8e403ac8256b780eceed
author: Dmitry Kovalev <[email protected]>
date: Tue Oct 29 07:24:08 EDT 2013
Correct handling of show_bit in uncompressed header. "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
--- 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)