]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/aacdec.c
Fixed size given to init_get_bits().
[ffmpeg] / libavformat / aacdec.c
index 4ac2cadb8ffb8df06f80347600725ffbe16d2b89..c3a502926011442d8b33191971d0980586c2661f 100644 (file)
@@ -47,6 +47,7 @@ static int adts_aac_probe(AVProbeData *p)
             fsize = (AV_RB32(buf2 + 3) >> 13) & 0x1FFF;
             if(fsize < 7)
                 break;
+            fsize = FFMIN(fsize, end - buf2);
             buf2 += fsize;
         }
         max_frames = FFMAX(max_frames, frames);
@@ -82,12 +83,11 @@ static int adts_aac_read_header(AVFormatContext *s,
 }
 
 AVInputFormat ff_aac_demuxer = {
-    "aac",
-    NULL_IF_CONFIG_SMALL("raw ADTS AAC"),
-    0,
-    adts_aac_probe,
-    adts_aac_read_header,
-    ff_raw_read_partial_packet,
+    .name           = "aac",
+    .long_name      = NULL_IF_CONFIG_SMALL("raw ADTS AAC"),
+    .read_probe     = adts_aac_probe,
+    .read_header    = adts_aac_read_header,
+    .read_packet    = ff_raw_read_partial_packet,
     .flags= AVFMT_GENERIC_INDEX,
     .extensions = "aac",
     .value = CODEC_ID_AAC,