Fix bug in error handling that causes segfault
See: https://code.google.com/p/chromium/issues/detail?id=362697 The code properly catches an invalid stream but seg faults instead of returning an error due to a buffer not having been initialized. This code fixes that. Change-Id: I695595e742cb08807e1dfb2f00bc097b3eae3a9b
This commit is contained in:
committed by
Gerrit Code Review
parent
edbd05ff10
commit
88ba08818e
@@ -1077,7 +1077,7 @@ static size_t read_uncompressed_header(VP9Decoder *pbi,
|
||||
// Show an existing frame directly.
|
||||
const int frame_to_show = cm->ref_frame_map[vp9_rb_read_literal(rb, 3)];
|
||||
|
||||
if (cm->frame_bufs[frame_to_show].ref_count < 1)
|
||||
if (frame_to_show < 0 || cm->frame_bufs[frame_to_show].ref_count < 1)
|
||||
vpx_internal_error(&cm->error, VPX_CODEC_UNSUP_BITSTREAM,
|
||||
"Buffer %d does not contain a decoded frame",
|
||||
frame_to_show);
|
||||
|
||||
Reference in New Issue
Block a user