aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Härdin <tomas.hardin@codemill.se>2011-03-21 10:52:36 +0100
committerAnton Khirnov <anton@khirnov.net>2011-05-12 18:02:28 +0200
commitee81e76db119c4ac4f52404d9d826969975aa77f (patch)
treec9535f72e5957a554a6c61fba8f5e6405786adb7
parent89d4c130574c6f2a617c5fde6f9b8a82da7a1e28 (diff)
downloadffmpeg-ee81e76db119c4ac4f52404d9d826969975aa77f.tar.gz
wmaenc: improve channel count and bitrate error handling in encode_init()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Anton Khirnov <anton@khirnov.net>
-rw-r--r--libavcodec/wmaenc.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/libavcodec/wmaenc.c b/libavcodec/wmaenc.c
index d2e811fd49..3cdb4a0b9b 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;