On Wed, Feb 22, 2012 at 02:37:19PM -0800, Ronald S. Bultje wrote:
> From: "Ronald S. Bultje" <[email protected]>
> 
> Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
> CC: [email protected]
> ---
>  libavcodec/apedec.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
> index a9953e1..3542a22 100644
> --- a/libavcodec/apedec.c
> +++ b/libavcodec/apedec.c
> @@ -287,7 +287,7 @@ static inline void range_dec_normalize(APEContext *ctx)
>  static inline int range_decode_culfreq(APEContext *ctx, int tot_f)
>  {
>      range_dec_normalize(ctx);
> -    ctx->rc.help = ctx->rc.range / tot_f;
> +    ctx->rc.help = FFMAX(ctx->rc.range / tot_f, 1);
>      return ctx->rc.low / ctx->rc.help;
>  }
>  
> @@ -299,7 +299,7 @@ static inline int range_decode_culfreq(APEContext *ctx, 
> int tot_f)
>  static inline int range_decode_culshift(APEContext *ctx, int shift)
>  {
>      range_dec_normalize(ctx);
> -    ctx->rc.help = ctx->rc.range >> shift;
> +    ctx->rc.help = FFMAX(ctx->rc.range >> shift, 1);
>      return ctx->rc.low / ctx->rc.help;
>  }
>  
> -- 

I'd prefer it to error out in this situation, it's definitely not normal.
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to