aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/mxfdec.c
diff options
context:
space:
mode:
authorTomas Härdin <tomas.hardin@codemill.se>2012-01-26 13:21:31 +0100
committerDiego Biurrun <diego@biurrun.de>2012-02-09 12:40:34 +0100
commita3923482f2a2b7895b1f6ef691765f035526fc78 (patch)
treeab647f083ec9fa4f085fc69fa47dfdeaaa4013b5 /libavformat/mxfdec.c
parentf769cfedd89db30e3d0fbf654138956779ea8053 (diff)
downloadffmpeg-a3923482f2a2b7895b1f6ef691765f035526fc78.tar.gz
mxfdec: Make sure x < index_table->nb_ptses
Avoids a SIGSEGV on files with IndexEntryCount < IndexDuration. Signed-off-by: Diego Biurrun <diego@biurrun.de>
Diffstat (limited to 'libavformat/mxfdec.c')
-rw-r--r--libavformat/mxfdec.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 96b662f431..d7f3c5ea44 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -1113,6 +1113,13 @@ static int mxf_compute_ptses_fake_index(MXFContext *mxf, MXFIndexTable *index_ta
int offset = s->temporal_offset_entries[j] / index_delta;
int index = x + offset;
+ if (x >= index_table->nb_ptses) {
+ av_log(mxf->fc, AV_LOG_ERROR,
+ "x >= nb_ptses - IndexEntryCount %i < IndexDuration %"PRId64"?\n",
+ s->nb_index_entries, s->index_duration);
+ break;
+ }
+
index_table->fake_index[x].timestamp = x;
index_table->fake_index[x].flags = !(s->flag_entries[j] & 0x30) ? AVINDEX_KEYFRAME : 0;