Bug 452773 - crashes the application if fonts.dir is empty or curropted
Summary: crashes the application if fonts.dir is empty or curropted
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: pygame
Version: 9
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Christopher Stone
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-06-24 23:14 UTC by Muayyad Alsadi
Modified: 2008-09-16 23:29 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-09-16 23:29:36 UTC
Type: ---
Embargoed:


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

Description Muayyad Alsadi 2008-06-24 23:14:35 UTC
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
    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 23:14:35 UTC
Created attachment 310202 [details]
patch that uses try/except to avoid crash

Comment 2 Rene Dudfield 2008-07-11 06:34:00 UTC
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 20:44:42 UTC
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 06:45:16 UTC
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 23:29:29 UTC
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.