On 05/12/2011 01:56 AM, Anton Khirnov wrote:

> From: Tomas Härdin <tomas.har...@codemill.se>
> 
> Signed-off-by: Michael Niedermayer <michae...@gmx.at>
> Signed-off-by: Anton Khirnov <an...@khirnov.net>
> ---
>  libavcodec/wmaenc.c |   16 +++++++++++-----
>  1 files changed, 11 insertions(+), 5 deletions(-)
> 
> diff --git a/libavcodec/wmaenc.c b/libavcodec/wmaenc.c
> index d2e811f..3cdb4a0 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;


patch is ok.

-Justin

_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to