Bug 452773 - crashes the application if fonts.dir is empty or curropted
crashes the application if fonts.dir is empty or curropted
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: pygame (Show other bugs)
9
All Linux
low Severity low
: ---
: ---
Assigned To: Christopher Stone
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-06-24 19:14 EDT by Muayyad Alsadi
Modified: 2008-09-16 19:29 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-09-16 19:29:36 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
patch that uses try/except to avoid crash (868 bytes, patch)
2008-06-24 19:14 EDT, Muayyad Alsadi
no flags Details | Diff

  None (edit)
Description Muayyad Alsadi 2008-06-24 19:14:35 EDT
Description of problem:
I have some installed fonts with empty fonts.dir file
and when I start solarwolf it crashed
the problem was

Version-Release number of selected component (if applicable):
1.7.1-17.fc9

How reproducible:
every time

Steps to Reproduce:
1. install msttcore-fonts or make an empty fonts.dir
2. run solarworlf or any pygame application


Additional info:
it can be fixed easily by editing
/usr/lib/python2.5/site-packages/pygame/sysfont.py to replace this line
    numfonts = int(file.readline())
with the following three lines
    # don't crash when fonts.dir is empty or corrupted, fixed by alsadi@ojuba.org
    try: numfonts = int(file.readline())
    except: return

same fix should be repeated for
/usr/share/solarwolf/code/mysysfont.py

in solarwolf-1.5-2.fc8.noarch


I emailed abartlet samba org to fix his spec file for msttcore-fonts
Comment 1 Muayyad Alsadi 2008-06-24 19:14:35 EDT
Created attachment 310202 [details]
patch that uses try/except to avoid crash
Comment 2 Rene Dudfield 2008-07-11 02:34:00 EDT
Hi,

also note this bug should not happen with pygame 1.8+ since it changed the
sysfont handling.
Comment 3 Fedora Update System 2008-08-25 16:44:42 EDT
pygame-1.8.0-2.fc9 has been submitted as an update for Fedora 9.
http://admin.fedoraproject.org/updates/pygame-1.8.0-2.fc9
Comment 4 Fedora Update System 2008-09-10 02:45:16 EDT
pygame-1.8.1-1.fc9 has been pushed to the Fedora 9 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update pygame'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F9/FEDORA-2008-7606
Comment 5 Fedora Update System 2008-09-16 19:29:29 EDT
pygame-1.8.1-1.fc9 has been pushed to the Fedora 9 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.