[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] PATCH: font lookup infine loop



Hello,

this has been applied in subversion.

Committed revision 964.

Thanks!

On 9/9/06, Regis Desgroppes <rdesgroppes@xxxxxxxxxxxxxxxxxxxx> wrote:
Hello,
When a font with normal style exists in your system but not with the
style you are looking for, an infinite loop may occur.
This bug is in pygame 1.7 release. It occurs with various fonts (e.g.
Courier Bold) at least on Debian & RedHat GNU/Linux powered computers.
It is due to the fact that, in the loop (see SysFont function),
"fontname" (font with the expected style) is compared to "plainname"
(font with normal style) even if fontname is None. Moreover, if fontname
is None, it is not reassigned to plainname (due to the "elif") what
prevents exiting from the loop.
The attached patch consists in first testing if there's no fontname
before comparing fontname to plainname.
Could you consider applying this patch in the next release ?
Thank you,
Regis.

--
------------------------------------------------------------------------
Regis C. Desgroppes, software geek
Parkeon (former Schlumberger e-City) - AFC - R&D
e-mail: rdesgroppes@xxxxxxxxxxxxxxxxxxxx
phone : +33 (0)3 81 54 68 73
fax   : +33 (0)3 81 54 49 90
------------------------------------------------------------------------
C++ mailing: Scott Meyers
<http://groups.yahoo.com/group/scott_meyers/join>, Herb Sutter
<http://groups.yahoo.com/group/herb_sutter/join>, Boost users
<http://groups.yahoo.com/group/Boost-Users/join>
no software patents <http://www.nosoftwarepatents.com>
Given enough eyeballs, all bugs are shallow. (Eric S Raymond)