aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2013-09-11 22:53:15 +0300
committerMartin Storsjö <martin@martin.st>2013-09-12 10:54:27 +0300
commit17d57848fc14e82f76a65ffb25c90f2f011dc4a0 (patch)
treeb72a5bde6617c9326c74dfe95a0ef2fcc368dc1e /libavformat
parent459f2b393a3f89ed08d10fbceb4738d1429f268e (diff)
downloadffmpeg-17d57848fc14e82f76a65ffb25c90f2f011dc4a0.tar.gz
mpc8: Make sure the first stream exists before parsing the seek table
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/mpc8.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/mpc8.c b/libavformat/mpc8.c
index 29001b19f6..3564e81c32 100644
--- a/libavformat/mpc8.c
+++ b/libavformat/mpc8.c
@@ -139,6 +139,11 @@ static void mpc8_parse_seektable(AVFormatContext *s, int64_t off)
int i, t, seekd;
GetBitContext gb;
+ if (s->nb_streams == 0) {
+ av_log(s, AV_LOG_ERROR, "No stream added before parsing seek table\n");
+ return;
+ }
+
avio_seek(s->pb, off, SEEK_SET);
mpc8_get_chunk_header(s->pb, &tag, &size);
if(tag != TAG_SEEKTABLE){