From 061ad1aefc48e6efc9ed94bb8aef886847bb3655 Mon Sep 17 00:00:00 2001 From: Miriam Ruiz Date: Mon, 1 Dec 2008 09:08:18 +0100 Subject: [PATCH] Fix crash when SDLPango_Draw is called with an empty string See http://bugs.debian.org/439071 Copyright (C) 2007 Jens Seidel Patch obtained from Debian Package release 0.1.2-4 --- src/SDL_Pango.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/SDL_Pango.c b/src/SDL_Pango.c index 1b304cd..fe67da1 100644 --- a/src/SDL_Pango.c +++ b/src/SDL_Pango.c @@ -932,7 +932,9 @@ SDLPango_Draw( width = PANGO_PIXELS (logical_rect.width); height = PANGO_PIXELS (logical_rect.height); - SDL_FillRect(surface, NULL, SDL_MapRGBA(surface->format, 0, 0, 0, 0)); + if (width && height) { + SDL_FillRect(surface, NULL, SDL_MapRGBA(surface->format, 0, 0, 0, 0)); + } if((! context->tmp_ftbitmap) || context->tmp_ftbitmap->width < width || context->tmp_ftbitmap->rows < height) -- 2.11.4.GIT