[FFmpeg-cvslog] In mov and flv muxer, check aac bitstream validity.

Stefano Sabatini stefano.sabatini-lala at poste.it
Mon Apr 18 23:46:22 CEST 2011


On date Monday 2011-04-18 23:31:27 +0200, Baptiste Coudurier wrote:
> ffmpeg | branch: master | Baptiste Coudurier <baptiste.coudurier at gmail.com> | Fri Jan 28 21:32:09 2011 -0800| [c22f2527ed33c429022dee6ee9e70c349145343e] | committer: Baptiste Coudurier
> 
> In mov and flv muxer, check aac bitstream validity.
> 
> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c22f2527ed33c429022dee6ee9e70c349145343e
> ---
> 
>  libavformat/flvenc.c |    6 ++++++
>  libavformat/movenc.c |    4 ++++
>  2 files changed, 10 insertions(+), 0 deletions(-)
> 
> diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
[...]
> @@ -402,6 +404,10 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt)
>          }
>          if (!flv->delay && pkt->dts < 0)
>              flv->delay = -pkt->dts;
> +    } else if (enc->codec_id == CODEC_ID_AAC && pkt->size > 2 &&
> +               (AV_RB16(pkt->data) & 0xfff0) == 0xfff0) {
> +        av_log(s, AV_LOG_ERROR, "malformated aac bitstream, use -absf aac_adtstoasc\n");

> +        return -1;

Please use proper error codes.
-- 
Men take only their needs into consideration -- never their abilities.
		-- Napoleon Bonaparte


More information about the ffmpeg-cvslog mailing list