From a40f2d767f06e1840995a95247584bd39fc2e98e Mon Sep 17 00:00:00 2001 From: Matthias Kramm Date: Wed, 14 Apr 2010 15:11:26 -0700 Subject: [PATCH] fixed segfault --- lib/gfximage.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/gfximage.c b/lib/gfximage.c index 3e6cfde..62b60c5 100644 --- a/lib/gfximage.c +++ b/lib/gfximage.c @@ -254,9 +254,11 @@ gfximage_t* gfximage_rescale(gfximage_t*image, int newwidth, int newheight) rgba_int_t*tmpline; int monochrome = 0; gfxcolor_t monochrome_colors[2]; - - if(newwidth<1 || newheight<1) - return 0; + + if(newwidth<1) + newwidth=1; + if(newheight<1) + newheight=1; int width = image->width; int height = image->height; -- 1.7.10.4