summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c190ec7)
raw | patch | inline | side by side (parent: c190ec7)
author | Krzysztof Kosiński <tweenk.pl@gmail.com> | |
Sun, 31 Jan 2010 20:38:02 +0000 (21:38 +0100) | ||
committer | Krzysztof Kosiński <tweenk.pl@gmail.com> | |
Sun, 31 Jan 2010 20:38:02 +0000 (21:38 +0100) |
src/sp-image.cpp | patch | blob | history |
diff --git a/src/sp-image.cpp b/src/sp-image.cpp
index daf5e9e88577c98ac51fd2677973a6fb6c78ed39..22b83670359662d3922bd37dd997d5f8adf6907a 100644 (file)
--- a/src/sp-image.cpp
+++ b/src/sp-image.cpp
@@ -328,6 +328,16 @@ static GdkPixbuf* pixbuf_new_from_file( const char *filename, time_t &modTime, g
);
if ( pngPtr )
{
+ if ( setjmp(png_jmpbuf(pngPtr)) )
+ {
+ // libpng calls longjmp to return here if an error occurs.
+ png_destroy_read_struct( &pngPtr, &infoPtr, NULL );
+ fclose(fp);
+ gdk_pixbuf_loader_close(loader, NULL);
+ g_object_unref(loader);
+ return NULL;
+ }
+
infoPtr = png_create_info_struct( pngPtr );
//endPtr = png_create_info_struct( pngPtr );