]> www.fi.muni.cz Git - evince.git/commitdiff
Make sure to always set @error when returning FALSE.
authorChristian Persch <chpe@src.gnome.org>
Sun, 15 Feb 2009 13:52:56 +0000 (13:52 +0000)
committerChristian Persch <chpe@src.gnome.org>
Sun, 15 Feb 2009 13:52:56 +0000 (13:52 +0000)
* backend/tiff/tiff-document.c: (tiff_document_load): Make sure
to always set @error when returning FALSE.

svn path=/trunk/; revision=3453

ChangeLog
backend/tiff/tiff-document.c

index 04ebd2b6e7b9452101d228d20790f6c5749848ea..3ef14dcbe41016253088042662783dc47356340b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-02-14  Christian Persch  <chpe@gnome.org>
+
+       * backend/tiff/tiff-document.c: (tiff_document_load): Make sure
+       to always set @error when returning FALSE.
+
 2009-02-14  Christian Persch  <chpe@gnome.org>
 
        * backend/comics/comics-document.c: (comics_document_load): Make sure
index 6969a1bdfc2e08f70c88f6094ef34aa4344e0ade..5501451cd5829a1c5be6765f3ab581cc51c0bbd0 100644 (file)
@@ -91,13 +91,11 @@ tiff_document_load (EvDocument  *document,
        gchar *filename;
        TIFF *tiff;
        
-       push_handlers ();
        filename = g_filename_from_uri (uri, NULL, error);
-       if (!filename) {
-               pop_handlers ();
+       if (!filename)
                return FALSE;
-       }
        
+       push_handlers ();
        tiff = TIFFOpen (filename, "r");
        if (tiff) {
                guint32 w, h;
@@ -109,6 +107,13 @@ tiff_document_load (EvDocument  *document,
        
        if (!tiff) {
                pop_handlers ();
+
+               g_set_error_literal (error,
+                                    EV_DOCUMENT_ERROR,
+                                    EV_DOCUMENT_ERROR_INVALID,
+                                    _("Invalid document"));
+
+               g_free (filename);
                return FALSE;
        }