TTF_OpenFont() seg-faults if file doesn't exist

Hi,

whilst looking into a problem with pygame, I found this bug.

If TTF_OpenFont( const char *file, …) is called and ‘file’ doesn’t
exist then a seg-fault is generated in TTF_OpenFontIndexRW because the
SDL_RWops *src parameter is NULL when it is used by SDL_RWtell(src).

Tiny patch enclosed,

cheers,
John.
-------------- next part --------------
A non-text attachment was scrubbed…
Name: sdl_ttf-patch.diff
Type: application/octet-stream
Size: 364 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20030327/11b24ab6/attachment-0007.obj

Hi,

this patch is more in keeping with the rest of SDL_ttf,

cheers,
John.> ----- Original Message -----

From: @John_Popplewell (John Popplewell)
To:
Sent: Friday, March 28, 2003 2:49 AM
Subject: [SDL] TTF_OpenFont() seg-faults if file doesn’t exist

Hi,

whilst looking into a problem with pygame, I found this bug.

If TTF_OpenFont( const char *file, …) is called and ‘file’ doesn’t
exist then a seg-fault is generated in TTF_OpenFontIndexRW because the
SDL_RWops *src parameter is NULL when it is used by SDL_RWtell(src).

Tiny patch enclosed,

cheers,
John.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed…
Name: sdl_ttf-patch.txt
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20030328/cf77fd0f/attachment-0007.txt