summaryrefslogtreecommitdiff
path: root/libavformat/mpc8.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-01-24 02:51:12 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-01-24 02:51:51 +0100
commit69fb605ad5e0f1384ca4d06d38ce0f1b6c8c286d (patch)
tree346c69d1547d06f57c864c3dca0181e4496ca7c2 /libavformat/mpc8.c
parentee9151b616fa7fa5e9b3258ecafd00c9f784baaa (diff)
mpc8: check stream count before accessing stream 1.
Fixes null pointer dereference Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mpc8.c')
-rw-r--r--libavformat/mpc8.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/mpc8.c b/libavformat/mpc8.c
index 011c7c8e64..73f805711d 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, "cannot parse stream table before stream header\n");
+ return;
+ }
+
avio_seek(s->pb, off, SEEK_SET);
mpc8_get_chunk_header(s->pb, &tag, &size);
if(tag != TAG_SEEKTABLE){