flvdec: reenable extradata passing code
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 21 May 2012 18:21:55 +0000 (20:21 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 21 May 2012 19:19:43 +0000 (21:19 +0200)
This fixes passing junk in stream.
It should not have any user vissible effect.
We are discarding the new data in the decoder as no case is known
where it is needed but it causes problems if used.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/aacdec.c
libavformat/flvdec.c

index b002f14..d4f48bb 100644 (file)
@@ -2556,7 +2556,7 @@ static int aac_decode_frame(AVCodecContext *avctx, void *data,
                                        AV_PKT_DATA_NEW_EXTRADATA,
                                        &new_extradata_size);
 
-    if (new_extradata) {
+    if (new_extradata && 0) {
         av_free(avctx->extradata);
         avctx->extradata = av_mallocz(new_extradata_size +
                                       FF_INPUT_BUFFER_PADDING_SIZE);
index 9f45447..d4cc7b9 100644 (file)
@@ -618,7 +618,7 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
             if (flv->wrong_dts)
                 dts = AV_NOPTS_VALUE;
         }
-        if (type == 0 && !st->codec->extradata) {
+        if (type == 0 && (!st->codec->extradata || st->codec->codec_id == CODEC_ID_AAC)) {
             if (st->codec->extradata) {
                 if ((ret = flv_queue_extradata(flv, s->pb, stream_type, size)) < 0)
                     return ret;