Mercurial > libavformat.hg
diff mp3.c @ 2703:2c2da3011d6e libavformat
make sure the mpeg audio header is valid before passing it to ff_mpegaudio_decode_header()
author | andoma |
---|---|
date | Sun, 04 Nov 2007 19:52:08 +0000 |
parents | e896ac505ec6 |
children | 6fba7e16a6c7 |
line wrap: on
line diff
--- a/mp3.c Sun Nov 04 12:46:16 2007 +0000 +++ b/mp3.c Sun Nov 04 19:52:08 2007 +0000 @@ -435,7 +435,11 @@ const offset_t xing_offtbl[2][2] = {{32, 17}, {17,9}}; MPADecodeContext c; - ff_mpegaudio_decode_header(&c, get_be32(&s->pb)); + v = get_be32(&s->pb); + if(ff_mpa_check_header(v) < 0) + return; + + ff_mpegaudio_decode_header(&c, v); if(c.layer != 3) return;