aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2013-09-11 22:53:15 +0300
committerLuca Barbato <lu_zero@gentoo.org>2014-01-07 09:43:56 +0100
commit9291012d52a7eddda1ffa32c46d3fb6f1953b11e (patch)
treea3bc757a132d48c2b8a316dbd3466ec60de51a6b /libavformat
parent486c45767587151b517bb6fde602d43d178da203 (diff)
downloadffmpeg-9291012d52a7eddda1ffa32c46d3fb6f1953b11e.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> (cherry picked from commit 17d57848fc14e82f76a65ffb25c90f2f011dc4a0) Signed-off-by: Luca Barbato <lu_zero@gentoo.org> (cherry picked from commit 557df77eab7d3726c34221aeb999afe9e7818d52)
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 97a9b01025..785a4f7a1c 100644
--- a/libavformat/mpc8.c
+++ b/libavformat/mpc8.c
@@ -137,6 +137,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){