diff options
author | Tomas Härdin <tomas.hardin@codemill.se> | 2011-03-21 10:52:36 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-03-24 15:00:28 +0100 |
commit | 0cd138340e5d7c668eb392721fa0015e5732cb39 (patch) | |
tree | 8de8054812647e826a06ead849f807d2ce107f20 /libavcodec/wmaenc.c | |
parent | 2fd41c9067fc67b40f80e9cbd4787018009040db (diff) | |
download | ffmpeg-0cd138340e5d7c668eb392721fa0015e5732cb39.tar.gz |
Improve channel count and bitrate error handling in wmav* encode_init()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/wmaenc.c')
-rw-r--r-- | libavcodec/wmaenc.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/libavcodec/wmaenc.c b/libavcodec/wmaenc.c index 9112918382..0bafe1a64d 100644 --- a/libavcodec/wmaenc.c +++ b/libavcodec/wmaenc.c @@ -33,11 +33,17 @@ static int encode_init(AVCodecContext * avctx){ s->avctx = avctx; - if(avctx->channels > MAX_CHANNELS) - return -1; + if(avctx->channels > MAX_CHANNELS) { + av_log(avctx, AV_LOG_ERROR, "too many channels: got %i, need %i or fewer", + avctx->channels, MAX_CHANNELS); + return AVERROR(EINVAL); + } - if(avctx->bit_rate < 24*1000) - return -1; + if(avctx->bit_rate < 24*1000) { + av_log(avctx, AV_LOG_ERROR, "bitrate too low: got %i, need 24000 or higher\n", + avctx->bit_rate); + return AVERROR(EINVAL); + } /* extract flag infos */ flags1 = 0; |