summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2018-07-04 01:23:45 +0200
committerMarton Balint <cus@passwd.hu>2018-07-13 22:58:40 +0200
commite5ff2c0c06188ff47706ce62db771b6b45f86b8c (patch)
tree9076d6f0c00b09f88c1b11d59ecb5ba18b8f0210 /libavformat
parent3e0f3be2b027ce2be1ed0f25651286f4f42123d5 (diff)
avformat/mxfdec: only return stream indexes which have a corresponding track
Without this check some crafted files might crash because a packet might be demuxed which have no corresponding mxf track. Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/mxfdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 3a8e76e51c..996969d1ff 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -423,7 +423,7 @@ static int mxf_get_stream_index(AVFormatContext *s, KLVPacket *klv, int body_sid
return i;
}
/* return 0 if only one stream, for OP Atom files with 0 as track number */
- return s->nb_streams == 1 ? 0 : -1;
+ return s->nb_streams == 1 && s->streams[0]->priv_data ? 0 : -1;
}
static int find_body_sid_by_offset(MXFContext *mxf, int64_t offset)