freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft-devel] suspicious code in FT_Set_Renderer


From: Werner LEMBERG
Subject: Re: [ft-devel] suspicious code in FT_Set_Renderer
Date: Mon, 13 Dec 2010 20:18:27 +0100 (CET)

>>> I believe that iteration over parameters expected here. Like:
>>>
>>> --- src/base/ftobjs.c       (old)
>>> +++ src/base/ftobjs.c       (new)
>>> @@ -3887,6 +3887,7 @@
>>>         error = set_mode( renderer, parameters->tag, parameters->data );
>>>         if ( error )
>>>           break;
>>> +        parameters++;
>>>       }
>>>     }
>>
>> Have you seen the `num_params--' in the `for' loop?  It starts with
>> num_params, then comes num_params-1, num_params-2, etc.
>
> Still, why call set_mode() repeatedly if renderer and parameters are
> the same each time?  FT_Set_Renderer() seems to expect parameters[]
> to be an array with num_params elements, but only the first element,
> parameters[0], is being accessed. It looks suspiciously like the
> code is missing "parameters++" as the original poster
> suggested.

Oops!  I was too fast in answering.  Yes, of course `parameters++' is
missing.

Fixed in git, and thanks for the report.


    Werner



reply via email to

[Prev in Thread] Current Thread [Next in Thread]