Commit 20c38f2e authored by John Stebbins's avatar John Stebbins Committed by Michael Niedermayer

lavf/mov: don't read outside frag_index bounds

Potentially fixes:
https://bugs.chromium.org/p/chromium/issues/detail?id=786269#c1

In theory, the crash can be triggered by an invalid stream that has
either tfdt or trun outside of the moof
Reviewed-by: 's avatarDale Curtis <dalecurtis@chromium.org>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 5eaaffaf
......@@ -1188,6 +1188,10 @@ static void set_frag_stream(MOVFragmentIndex *frag_index, int id)
static MOVFragmentStreamInfo * get_current_frag_stream_info(
MOVFragmentIndex *frag_index)
{
if (frag_index->current < 0 ||
frag_index->current >= frag_index->nb_items)
return NULL;
MOVFragmentIndexItem * item = &frag_index->item[frag_index->current];
if (item->current >= 0 && item->current < item->nb_stream_info)
return &item->stream_info[item->current];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment