[FFmpeg-devel] [PATCH] IFF: Check for invalid width and height in decoder

Sebastian Vater cdgs.basty
Mon May 10 16:07:41 CEST 2010


Ronald S. Bultje a ?crit :
> Hi,
>
> On Mon, May 10, 2010 at 9:58 AM, Sebastian Vater
> <cdgs.basty at googlemail.com> wrote:
>   
>> Ronald S. Bultje a ?crit :
>>     
>>> On Mon, May 10, 2010 at 9:48 AM, Sebastian Vater
>>> <cdgs.basty at googlemail.com> wrote:
>>>       
>>>> +    if ( (err = avcodec_check_dimensions(avctx, avctx->width, avctx->height)) )
>>>> +        return err;
>>>>         
>>> Now without the ( ( ( spaces. OK otherwise.
>>>       
>> I wanted to do this, too. But thought it could be a nice remember that
>> the = instead of == is really wanted here.
>>     
> [..]
>   
>> +    if (err = avcodec_check_dimensions(avctx, avctx->width, avctx->height) )
>> +        return err;
>>     
>
> I think we misunderstand. The extra (..) are required, gcc will warn
> without them. The extra spaces around the ( and ) are not.
>   

Oh ok!

> What we usually do is this:
>    if ((err = avcodec_check_dimensions(avctx, avctx->width, avctx->height)))
>        return err;
>   

Now it should be fine...

-- 

Best regards,
                   :-) Basty/CDGS (-:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: iff-decoder-width-height-check.patch
Type: text/x-patch
Size: 540 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100510/0e06c877/attachment.bin>



More information about the ffmpeg-devel mailing list