summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorTomas Härdin <tomas.hardin@codemill.se>2011-12-20 09:57:07 +0100
committerTomas Härdin <tomas.hardin@codemill.se>2011-12-20 09:58:37 +0100
commit6e9081f4d87b4ebcd3355ebd560307c59d2104c3 (patch)
tree138557ef320db50dbf7d369d2834831ae400a84c /libavformat
parent085249a37951046ef3e0556e4ccac2390afd9764 (diff)
mxfdec: Make sure x < index_table->nb_ptses
Without this the demuxer will SIGSEGV on files with IndexEntryCount < IndexDuration
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/mxfdec.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 8a5c3c96ef..ea1129388e 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -1085,6 +1085,12 @@ 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;