aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Cadhalpun <andreas.cadhalpun@googlemail.com>2015-12-19 23:47:54 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2015-12-20 02:42:13 +0100
commit63ecbb82fc1d6db23cda10b313c0435866d16384 (patch)
treebc7f577a143b272aa970227b895cf7d0442ee41d
parentbdc6ba460429d78a805c39fecaf7d101df36d11f (diff)
downloadffmpeg-63ecbb82fc1d6db23cda10b313c0435866d16384.tar.gz
mlvdec: check that index_entries exist
This fixes NULL pointer dereferencing. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/mlvdec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/mlvdec.c b/libavformat/mlvdec.c
index 48a429eb23..4b3bdc1eca 100644
--- a/libavformat/mlvdec.c
+++ b/libavformat/mlvdec.c
@@ -365,6 +365,11 @@ static int read_header(AVFormatContext *avctx)
if (ast)
ast->duration = ast->nb_index_entries;
+ if ((vst && !vst->nb_index_entries) || (ast && !ast->nb_index_entries)) {
+ av_log(avctx, AV_LOG_ERROR, "no index entries found\n");
+ return AVERROR_INVALIDDATA;
+ }
+
if (vst && ast)
avio_seek(pb, FFMIN(vst->index_entries[0].pos, ast->index_entries[0].pos), SEEK_SET);
else if (vst)