[FFmpeg-devel] [PATCH] ADTS Muxer: Refuse to write out illegal ADTS files

Robert Swain robert.swain
Thu Feb 12 12:58:55 CET 2009


2009/2/12 Alex Converse <alex.converse at gmail.com>:
> Right now we are part of the problem.

:)

> diff --git a/libavformat/adtsenc.c b/libavformat/adtsenc.c
> index 5c65d36..9566872 100644
> --- a/libavformat/adtsenc.c
> +++ b/libavformat/adtsenc.c

> @@ -41,6 +41,19 @@ static int decode_extradata(ADTSContext *adts, uint8_t *buf, int size)
>      adts->sample_rate_index = get_bits(&gb, 4);
>      adts->channel_conf = get_bits(&gb, 4);
>
> +    if (adts->objecttype > 3) {
> +        av_log(s, AV_LOG_ERROR, "MPEG-4 AOT %d is not allowed in ADTS\n", adts->objecttype);
> +        return -1;
> +    }

The error message is correct for "MPEG identifier" == 0 but not for ==
1. If ID == 1, the object types pertain to MPEG-2 AAC profiles as per
"Table 1.A.11 ? MPEG-2 Audio profiles and MPEG-4 Audio object types".
Also note that object type == 3 is reserved for ID == 1.

Regards,
Rob




More information about the ffmpeg-devel mailing list