mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
Improve channel count and bitrate error handling in wmav* encode_init()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
2fd41c9067
commit
0cd138340e
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user