[PATCH] Avoid a divide by zero crash.

Dmitry Timoshkov dmitry at baikal.ru
Sat Mar 1 04:07:06 CST 2014

Max Woodbury <mtewoodbury at gmail.com> wrote:

> >> While tmHeight is not _supposed_ to ever be zero, it is an external
> >>
> >> input and has been found to be zero in a few rare fonts.  Detecting
> >>
> >> and fixing THAT problem should be handled elsewhere.  This change just
> >>
> >> keeps the application from being blown away by a divide by zero
> >>
> >> exception.
> >
> > This change needs at least more details and preferrably a test case.
> >
> The test case was submitted about a year ago.
> What more details do you think are needed?
> tmHeight is an external input, so it can have any value including
> zero.  As such, it should NOT be used as a divisor.  This change uses
> it as a multiplier on the other side of the comparison so it should not
> cause THAT particular problem.  A little additional algebra simplifies
> the code.

Sounds like a deja-vu.


More information about the wine-devel mailing list