Laurent Aimar <[email protected]> writes:

> On Sat, Sep 17, 2011 at 04:56:31PM +0200, [email protected] wrote:
>> From: Laurent Aimar <[email protected]>
>> 
>> ---
>>  libavcodec/golomb.h |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>> 
>> diff --git a/libavcodec/golomb.h b/libavcodec/golomb.h
>> index 83d277f..58707ed 100644
>> --- a/libavcodec/golomb.h
>> +++ b/libavcodec/golomb.h
>> @@ -124,7 +124,7 @@ static inline int svq3_get_ue_golomb(GetBitContext *gb){
>>          }
>>  
>>          CLOSE_READER(re, gb);
>> -        return ret - 1;
>> +        return (ret - 1) & INT_MAX;
>
> A better patch from ffmpeg is attached.
>
> -- 
> fenrir
>
> From 979bea13003ef489d95d2538ac2fb1c26c6f103b Mon Sep 17 00:00:00 2001
> From: Michael Niedermayer <[email protected]>
> Date: Sat, 17 Sep 2011 21:53:21 +0200
> Subject: [PATCH 1/4] check all svq3_get_ue_golomb() returns.
>
> Signed-off-by: Michael Niedermayer <[email protected]>
> ---
>  libavcodec/dirac.c |   16 ++++++++--------
>  libavcodec/rv30.c  |    4 ++--
>  libavcodec/rv40.c  |    5 ++++-
>  libavcodec/svq3.c  |   12 ++++++------
>  4 files changed, 20 insertions(+), 17 deletions(-)
>
> diff --git a/libavcodec/dirac.c b/libavcodec/dirac.c
> index af0d799..1582a5f 100644
> --- a/libavcodec/dirac.c
> +++ b/libavcodec/dirac.c
> @@ -120,7 +120,7 @@ static int parse_source_parameters(AVCodecContext *avctx, 
> GetBitContext *gb,
>      // chroma subsampling
>      if (get_bits1(gb))
>          source->chroma_format = svq3_get_ue_golomb(gb);
> -    if (source->chroma_format > 2) {
> +    if (source->chroma_format > 2U) {

I think declaring the various variables as unsigned would be a better
solution.

-- 
Måns Rullgård
[email protected]
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to