Skip to content
Snippets Groups Projects
Commit 69fb605a authored by Michael Niedermayer's avatar Michael Niedermayer
Browse files

mpc8: check stream count before accessing stream 1.


Fixes null pointer dereference

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: default avatarMichael Niedermayer <michaelni@gmx.at>
parent ee9151b6
No related branches found
No related tags found
No related merge requests found
...@@ -139,6 +139,11 @@ static void mpc8_parse_seektable(AVFormatContext *s, int64_t off) ...@@ -139,6 +139,11 @@ static void mpc8_parse_seektable(AVFormatContext *s, int64_t off)
int i, t, seekd; int i, t, seekd;
GetBitContext gb; 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); avio_seek(s->pb, off, SEEK_SET);
mpc8_get_chunk_header(s->pb, &tag, &size); mpc8_get_chunk_header(s->pb, &tag, &size);
if(tag != TAG_SEEKTABLE){ if(tag != TAG_SEEKTABLE){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment