[poppler] poppler/CairoOutputDev.cc

Carlos Garcia Campos carlosgc at kemper.freedesktop.org
Fri Nov 27 06:27:20 PST 2009


 poppler/CairoOutputDev.cc |   12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

New commits:
commit 3a94e8ce90c0a4d11c5c5aa8805c167c8a0434e5
Author: Carlos Garcia Campos <carlosgc at gnome.org>
Date:   Fri Nov 27 15:23:11 2009 +0100

    [cairo] Revert commit 77c2e154c2cb57300116ecd4295f1e67b06b411f
    
    And fix bug #24575 jut by checking pointer is not null before using it.

diff --git a/poppler/CairoOutputDev.cc b/poppler/CairoOutputDev.cc
index 7e48b18..191fa33 100644
--- a/poppler/CairoOutputDev.cc
+++ b/poppler/CairoOutputDev.cc
@@ -258,10 +258,6 @@ void CairoOutputDev::saveState(GfxState *state) {
 
 void CairoOutputDev::restoreState(GfxState *state) {
   LOG(printf ("restore\n"));
-  if (!state->hasSaves()) {
-    error(-1, "restoreState on an empty state stack");
-    return;
-  }
   cairo_restore (cairo);
   if (cairo_shape)
       cairo_restore (cairo_shape);
@@ -278,9 +274,11 @@ void CairoOutputDev::restoreState(GfxState *state) {
   if (mask)
     cairo_pattern_destroy(mask);
 
-  mask = ms->mask;
-  maskStack = ms->next;
-  delete ms;
+  if (ms) {
+    mask = ms->mask;
+    maskStack = ms->next;
+    delete ms;
+  }
 }
 
 void CairoOutputDev::updateAll(GfxState *state) {


More information about the poppler mailing list