From: H.G.Muller Date: Sat, 27 Feb 2016 19:45:01 +0000 (+0100) Subject: Fix bug #45775 (Infinite loop on nonexistent texture file) X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=713f3a53e3efbd2e32d7111ad9fb63044904744b;p=xboard.git Fix bug #45775 (Infinite loop on nonexistent texture file) --- diff --git a/draw.c b/draw.c index afb6393..01add14 100644 --- a/draw.c +++ b/draw.c @@ -253,7 +253,7 @@ CreatePNGBoard (char *s, int kind) textureW[kind] = 0; // prevents bitmap from being used if not succesfully loaded if(strstr(s, ".png")) { cairo_surface_t *img = cairo_image_surface_create_from_png (s); - if(img) { + if(cairo_surface_status(img) == CAIRO_STATUS_SUCCESS) { char c, *p = s, *q; int r, f; if(pngOriginalBoardBitmap[kind]) cairo_surface_destroy(pngOriginalBoardBitmap[kind]);