[PATCH] dlls/gdi32/fretype.c: Avoid division by zero.

Max TenEyck Woodbury max at mtew.isa-geek.net
Sat May 4 00:39:53 CDT 2013


On 05/04/2013 12:38 AM, Dmitry Timoshkov wrote:
> max at mtew.isa-geek.net wrote:
>
>> +        if ( font->aveWidth && font->potm->otmTextMetrics.tmHeight ) {
>> +            if (((font->aveWidth + font->potm->otmTextMetrics.tmHeight - 1) /
>> +                 font->potm->otmTextMetrics.tmHeight) > 100) {
>>                   WARN("Ignoring too large font->aveWidth %d\n", font->aveWidth);
>>                   font->aveWidth = 0;
>>               }
>
> In which case font->potm->otmTextMetrics.tmHeight is going to be 0?
>
I am not sure what you are asking.  I have had this particular division
throw an exception for some font I have installed, but I have no idea
which one at the moment.  So if you are implying that font->aveWidth==0
is always true if font->potm->otmTextMetrics.tmHeight==0, that seems not
to be the case.



More information about the wine-devel mailing list