Re: gdi32: Simplify font->aveWidth sanity-checking to remove possible division by zero.
8 May
2013
8 May
'13
4:39 a.m.
Sam Edwards <cfsworks(a)gmail.com> wrote:
It makes the most sense to get rid of this sanity check altogether, but until then, this should be a more robust way of doing it.
+ * TODO: This sounds like a workaround for a much deeper bug involving + * aveWidth's calculation. We should investigate if/why this is needed. + */
This comment is confusing and wrong. There is a test case for which this check is required.
+ if (font->aveWidth < 0 || font->aveWidth > font->potm->otmTextMetrics.tmHeight * 100)
A check for an overflow is probably needed. Also a check for negative aveWidth should be a separate patch at best, and needs a test case. -- Dmitry.
4600
Age (days ago)
4600
Last active (days ago)
0 comments
1 participants
participants (1)
-
Dmitry Timoshkov