From 0f49d36875245876db71c547038d7dcf8bed4236 Mon Sep 17 00:00:00 2001 From: Carlos Garcia Campos Date: Tue, 1 Apr 2008 12:37:38 +0000 Subject: [PATCH] Do not crash when thumbnail failed to render in PS backend. Fixes bug 2008-04-01 Carlos Garcia Campos * backend/ps/ev-spectre.c: (ps_document_thumbnails_get_thumbnail): Do not crash when thumbnail failed to render in PS backend. Fixes bug #525015. svn path=/trunk/; revision=2986 --- ChangeLog | 7 +++++++ backend/ps/ev-spectre.c | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/ChangeLog b/ChangeLog index 1cb15f4b..1c4e001a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-04-01 Carlos Garcia Campos + + * backend/ps/ev-spectre.c: (ps_document_thumbnails_get_thumbnail): + + Do not crash when thumbnail failed to render in PS backend. Fixes + bug #525015. + 2008-03-31 Carlos Garcia Campos * shell/ev-window.c: (window_open_file_copy_ready_cb), diff --git a/backend/ps/ev-spectre.c b/backend/ps/ev-spectre.c index 7e8d27bb..6fe58692 100644 --- a/backend/ps/ev-spectre.c +++ b/backend/ps/ev-spectre.c @@ -351,6 +351,11 @@ ps_document_thumbnails_get_thumbnail (EvDocumentThumbnails *document_thumbnails, GdkPixbuf *pixbuf = NULL; surface = ps_document_render (EV_DOCUMENT (ps), rc); + if (!surface) { + g_warning ("Error rendering thumbnail"); + return NULL; + } + pixbuf = ev_document_misc_pixbuf_from_surface (surface); cairo_surface_destroy (surface); -- 2.43.5