diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2012-12-23 13:17:05 -0500 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2013-01-09 11:52:56 -0500 |
commit | 3f98848d6e04a11f28e776b665fb14e58d56e015 (patch) | |
tree | 0bc01dbeba969318d2331ff4a2d92425a4940767 /libavformat/au.c | |
parent | 71194ef6a8ffe7cfd32b0db465de9f1fd0202eb3 (diff) | |
download | ffmpeg-3f98848d6e04a11f28e776b665fb14e58d56e015.tar.gz |
au: validate bits-per-sample separately from codec tag
Diffstat (limited to 'libavformat/au.c')
-rw-r--r-- | libavformat/au.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libavformat/au.c b/libavformat/au.c index 8f9a3facd1..5499c6bd75 100644 --- a/libavformat/au.c +++ b/libavformat/au.c @@ -64,6 +64,7 @@ static int au_read_header(AVFormatContext *s) unsigned int tag; AVIOContext *pb = s->pb; unsigned int id, channels, rate; + int bps; enum AVCodecID codec; AVStream *st; @@ -80,7 +81,13 @@ static int au_read_header(AVFormatContext *s) codec = ff_codec_get_id(codec_au_tags, id); - if (!av_get_bits_per_sample(codec)) { + if (codec == AV_CODEC_ID_NONE) { + av_log_ask_for_sample(s, "unknown or unsupported codec tag: %d\n", id); + return AVERROR_PATCHWELCOME; + } + + bps = av_get_bits_per_sample(codec); + if (!bps) { av_log_ask_for_sample(s, "could not determine bits per sample\n"); return AVERROR_PATCHWELCOME; } |