On Mon, Nov 18, 2013 at 12:41:47PM +0100, Tim Walker wrote:
> --- a/libavcodec/ac3dec.c
> +++ b/libavcodec/ac3dec.c
> @@ -178,9 +178,8 @@ static av_cold int ac3_decode_init(AVCodecContext *avctx)
>  
>      /* allow downmixing to stereo or mono */
> -    if (avctx->channels > 0 && avctx->request_channels > 0 &&
> -            avctx->request_channels < avctx->channels &&
> -            avctx->request_channels <= 2) {
> +    if (avctx->request_channels > 0 && avctx->request_channels <= 2 &&
> +        avctx->request_channels < avctx->channels) {
>          avctx->channels = avctx->request_channels;

what ensures that avctx->channels is non-negative?  (Yes, I wonder why
that struct member is signed in the first place.)

Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to