[poppler] glib/poppler-annot.cc glib/poppler-form-field.cc glib/poppler-page.cc glib/poppler-private.h

Carlos Garcia Campos carlosgc at kemper.freedesktop.org
Sun Apr 19 00:04:15 PDT 2015


 glib/poppler-annot.cc      |    4 ++--
 glib/poppler-form-field.cc |    2 +-
 glib/poppler-page.cc       |    2 +-
 glib/poppler-private.h     |    2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 040b316f0cb1ac933dce616fabe24c93f96fe1cd
Author: Jason Crain <jason at aquaticape.us>
Date:   Sat Apr 18 12:44:47 2015 -0500

    glib: Fix segfault when creating PopplerAction
    
    Screen annotations and form fields currently pass a NULL pointer to
    _poppler_action_new.  Pass the PopplerDocument instead.
    
    Bug #90093

diff --git a/glib/poppler-annot.cc b/glib/poppler-annot.cc
index 15d48c5..312aa31 100644
--- a/glib/poppler-annot.cc
+++ b/glib/poppler-annot.cc
@@ -559,7 +559,7 @@ poppler_annot_screen_class_init (PopplerAnnotScreenClass *klass)
 }
 
 PopplerAnnot *
-_poppler_annot_screen_new (Annot *annot)
+_poppler_annot_screen_new (PopplerDocument *doc, Annot *annot)
 {
   PopplerAnnot *poppler_annot;
   AnnotScreen  *annot_screen;
@@ -569,7 +569,7 @@ _poppler_annot_screen_new (Annot *annot)
   annot_screen = static_cast<AnnotScreen *>(poppler_annot->annot);
   action = annot_screen->getAction();
   if (action)
-    POPPLER_ANNOT_SCREEN (poppler_annot)->action = _poppler_action_new (NULL, action, NULL);
+    POPPLER_ANNOT_SCREEN (poppler_annot)->action = _poppler_action_new (doc, action, NULL);
 
   return poppler_annot;
 }
diff --git a/glib/poppler-form-field.cc b/glib/poppler-form-field.cc
index 5687799..df184dd 100644
--- a/glib/poppler-form-field.cc
+++ b/glib/poppler-form-field.cc
@@ -188,7 +188,7 @@ poppler_form_field_get_action (PopplerFormField *field)
   if (!action)
     return NULL;
 
-  field->action = _poppler_action_new (NULL, action, NULL);
+  field->action = _poppler_action_new (field->document, action, NULL);
 
   return field->action;
 }
diff --git a/glib/poppler-page.cc b/glib/poppler-page.cc
index db2387a..1025393 100644
--- a/glib/poppler-page.cc
+++ b/glib/poppler-page.cc
@@ -1399,7 +1399,7 @@ poppler_page_get_annot_mapping (PopplerPage *page)
         mapping->annot = _poppler_annot_movie_new (annot);
 	break;
       case Annot::typeScreen:
-        mapping->annot = _poppler_annot_screen_new (annot);
+        mapping->annot = _poppler_annot_screen_new (page->document, annot);
 	break;
       case Annot::typeLine:
         mapping->annot = _poppler_annot_line_new (annot);
diff --git a/glib/poppler-private.h b/glib/poppler-private.h
index 874cfdb..9abdd7c 100644
--- a/glib/poppler-private.h
+++ b/glib/poppler-private.h
@@ -130,7 +130,7 @@ PopplerAnnot      *_poppler_annot_free_text_new (Annot *annot);
 PopplerAnnot      *_poppler_annot_text_markup_new     (Annot *annot);
 PopplerAnnot      *_poppler_annot_file_attachment_new (Annot *annot);
 PopplerAnnot      *_poppler_annot_movie_new (Annot *annot);
-PopplerAnnot      *_poppler_annot_screen_new (Annot *annot);
+PopplerAnnot      *_poppler_annot_screen_new (PopplerDocument *doc, Annot *annot);
 PopplerAnnot      *_poppler_annot_line_new (Annot *annot);
 PopplerAnnot      *_poppler_annot_circle_new (Annot *annot);
 PopplerAnnot      *_poppler_annot_square_new (Annot *annot);


More information about the poppler mailing list