diff options
author | Alex Converse <alex.converse@gmail.com> | 2009-03-06 21:19:16 +0000 |
---|---|---|
committer | Alex Converse <alex.converse@gmail.com> | 2009-03-06 21:19:16 +0000 |
commit | 496dcbbc86b679a3bc23421ed71a35ca1bb8fd9b (patch) | |
tree | a80092c08780b67f55a421d00c7e114f8268c8d4 | |
parent | 8507bde0f3b746875d93db80807f007d38562769 (diff) | |
download | ffmpeg-496dcbbc86b679a3bc23421ed71a35ca1bb8fd9b.tar.gz |
ADTS: Increased protection against writing illegal/nonsense files.
Originally committed as revision 17859 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavformat/adtsenc.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/libavformat/adtsenc.c b/libavformat/adtsenc.c index 9916b92ac6..70e252e2b6 100644 --- a/libavformat/adtsenc.c +++ b/libavformat/adtsenc.c @@ -42,7 +42,7 @@ static int decode_extradata(AVFormatContext *s, ADTSContext *adts, uint8_t *buf, adts->sample_rate_index = get_bits(&gb, 4); adts->channel_conf = get_bits(&gb, 4); - if (adts->objecttype > 3) { + if (adts->objecttype > 3U) { av_log(s, AV_LOG_ERROR, "MPEG-4 AOT %d is not allowed in ADTS\n", adts->objecttype+1); return -1; } @@ -54,6 +54,18 @@ static int decode_extradata(AVFormatContext *s, ADTSContext *adts, uint8_t *buf, ff_log_missing_feature(s, "PCE based channel configuration", 0); return -1; } + if (get_bits(&gb, 1)) { + av_log(s, AV_LOG_ERROR, "960/120 MDCT window is not allowed in ADTS\n"); + return -1; + } + if (get_bits(&gb, 1)) { + av_log(s, AV_LOG_ERROR, "Scalable configurations are not allowed in ADTS\n"); + return -1; + } + if (get_bits(&gb, 1)) { + ff_log_missing_feature(s, "Signaled SBR or PS", 0); + return -1; + } adts->write_adts = 1; |