Package: sdl-ttf2.0
Severity: minor
Version: 2.0.9-1

When using TrueType fonts with embedded bitmaps, it gets segmentation
faults. I wrote a small program to reproduce the bug. Please read the
attachment for the program. The program use fonts from
"ttf-kochi-gothic" package, please also install it before reproducing
the bug.

However, this bug has been reported to the upstream and the upstream has
fixed this bug. We can wait for new upstream version to solve it.
Please read http://bugzilla.libsdl.org/show_bug.cgi?id=190
I report it here just for easier tracking.

Regards,
 Ying-Chun Liu

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.21-2-k7 (SMP w/1 CPU core)
Locale: LANG=zh_TW.UTF-8, LC_CTYPE=zh_TW.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash


-- 
                                                PaulLiu(劉穎駿)
E-mail address: [EMAIL PROTECTED]
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <SDL_ttf.h>
#include <SDL.h>

/*
gcc -g -o crashsdlttf crashsdlttf.c `sdl-config --cflags` \
`sdl-config --libs` -lSDL_ttf
*/

int main() {
  SDL_Color fcolor={0xff, 0xff, 0xff}, bcolor={0, 0, 0};
  Uint16 text = 21517; /* Name */
  TTF_Font *font = NULL;
  SDL_Surface *tmp,*screenSurface;

  if ( SDL_Init( SDL_INIT_VIDEO | SDL_INIT_TIMER | SDL_INIT_AUDIO ) < 0 ){
    fprintf( stderr, "Couldn't initialize SDL: %s\n", SDL_GetError() );
    exit(-1);
  }
  if ( TTF_Init() < 0 ){
    fprintf( stderr, "Can't initialize SDL TTF\n");
    exit(-1);
  }

  screenSurface = SDL_SetVideoMode( 800,600,24,0);                          
  
  font = TTF_OpenFont ("/usr/share/fonts/truetype/kochi/kochi-gothic.ttf",20); /* crash */
  // font = TTF_OpenFont ("/usr/share/fonts/truetype/kochi/kochi-gothic.ttf",24); /* no problem */
  
  tmp = TTF_RenderGlyph_Shaded( font, text, fcolor, bcolor );
  if (tmp!=NULL) {
    SDL_FreeSurface(tmp);
    printf ("OK\n");
  }
  return 0;
}

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to