|
|
2418db |
From 1e6541a3a443db7afd3046483c0fd994b31d128c Mon Sep 17 00:00:00 2001
|
|
|
2418db |
From: Jason Crain <jason@aquaticape.us>
|
|
|
2418db |
Date: Sat, 18 Apr 2015 12:44:47 -0500
|
|
|
2418db |
Subject: [PATCH] glib: Fix segfault when creating PopplerAction
|
|
|
2418db |
|
|
|
2418db |
Screen annotations and form fields currently pass a NULL pointer to
|
|
|
2418db |
_poppler_action_new. Pass the PopplerDocument instead.
|
|
|
2418db |
|
|
|
2418db |
Bug #90093
|
|
|
2418db |
---
|
|
|
2418db |
glib/poppler-annot.cc | 4 ++--
|
|
|
2418db |
glib/poppler-form-field.cc | 2 +-
|
|
|
2418db |
glib/poppler-page.cc | 2 +-
|
|
|
2418db |
glib/poppler-private.h | 2 +-
|
|
|
2418db |
4 files changed, 5 insertions(+), 5 deletions(-)
|
|
|
2418db |
|
|
|
2418db |
diff --git a/glib/poppler-annot.cc b/glib/poppler-annot.cc
|
|
|
2418db |
index 15d48c5..312aa31 100644
|
|
|
2418db |
--- a/glib/poppler-annot.cc
|
|
|
2418db |
+++ b/glib/poppler-annot.cc
|
|
|
2418db |
@@ -559,7 +559,7 @@ poppler_annot_screen_class_init (PopplerAnnotScreenClass *klass)
|
|
|
2418db |
}
|
|
|
2418db |
|
|
|
2418db |
PopplerAnnot *
|
|
|
2418db |
-_poppler_annot_screen_new (Annot *annot)
|
|
|
2418db |
+_poppler_annot_screen_new (PopplerDocument *doc, Annot *annot)
|
|
|
2418db |
{
|
|
|
2418db |
PopplerAnnot *poppler_annot;
|
|
|
2418db |
AnnotScreen *annot_screen;
|
|
|
2418db |
@@ -569,7 +569,7 @@ _poppler_annot_screen_new (Annot *annot)
|
|
|
2418db |
annot_screen = static_cast<AnnotScreen *>(poppler_annot->annot);
|
|
|
2418db |
action = annot_screen->getAction();
|
|
|
2418db |
if (action)
|
|
|
2418db |
- POPPLER_ANNOT_SCREEN (poppler_annot)->action = _poppler_action_new (NULL, action, NULL);
|
|
|
2418db |
+ POPPLER_ANNOT_SCREEN (poppler_annot)->action = _poppler_action_new (doc, action, NULL);
|
|
|
2418db |
|
|
|
2418db |
return poppler_annot;
|
|
|
2418db |
}
|
|
|
2418db |
diff --git a/glib/poppler-form-field.cc b/glib/poppler-form-field.cc
|
|
|
2418db |
index 5687799..df184dd 100644
|
|
|
2418db |
--- a/glib/poppler-form-field.cc
|
|
|
2418db |
+++ b/glib/poppler-form-field.cc
|
|
|
2418db |
@@ -188,7 +188,7 @@ poppler_form_field_get_action (PopplerFormField *field)
|
|
|
2418db |
if (!action)
|
|
|
2418db |
return NULL;
|
|
|
2418db |
|
|
|
2418db |
- field->action = _poppler_action_new (NULL, action, NULL);
|
|
|
2418db |
+ field->action = _poppler_action_new (field->document, action, NULL);
|
|
|
2418db |
|
|
|
2418db |
return field->action;
|
|
|
2418db |
}
|
|
|
2418db |
diff --git a/glib/poppler-page.cc b/glib/poppler-page.cc
|
|
|
2418db |
index db2387a..1025393 100644
|
|
|
2418db |
--- a/glib/poppler-page.cc
|
|
|
2418db |
+++ b/glib/poppler-page.cc
|
|
|
2418db |
@@ -1399,7 +1399,7 @@ poppler_page_get_annot_mapping (PopplerPage *page)
|
|
|
2418db |
mapping->annot = _poppler_annot_movie_new (annot);
|
|
|
2418db |
break;
|
|
|
2418db |
case Annot::typeScreen:
|
|
|
2418db |
- mapping->annot = _poppler_annot_screen_new (annot);
|
|
|
2418db |
+ mapping->annot = _poppler_annot_screen_new (page->document, annot);
|
|
|
2418db |
break;
|
|
|
2418db |
case Annot::typeLine:
|
|
|
2418db |
mapping->annot = _poppler_annot_line_new (annot);
|
|
|
2418db |
diff --git a/glib/poppler-private.h b/glib/poppler-private.h
|
|
|
2418db |
index 874cfdb..9abdd7c 100644
|
|
|
2418db |
--- a/glib/poppler-private.h
|
|
|
2418db |
+++ b/glib/poppler-private.h
|
|
|
2418db |
@@ -130,7 +130,7 @@ PopplerAnnot *_poppler_annot_free_text_new (Annot *annot);
|
|
|
2418db |
PopplerAnnot *_poppler_annot_text_markup_new (Annot *annot);
|
|
|
2418db |
PopplerAnnot *_poppler_annot_file_attachment_new (Annot *annot);
|
|
|
2418db |
PopplerAnnot *_poppler_annot_movie_new (Annot *annot);
|
|
|
2418db |
-PopplerAnnot *_poppler_annot_screen_new (Annot *annot);
|
|
|
2418db |
+PopplerAnnot *_poppler_annot_screen_new (PopplerDocument *doc, Annot *annot);
|
|
|
2418db |
PopplerAnnot *_poppler_annot_line_new (Annot *annot);
|
|
|
2418db |
PopplerAnnot *_poppler_annot_circle_new (Annot *annot);
|
|
|
2418db |
PopplerAnnot *_poppler_annot_square_new (Annot *annot);
|
|
|
2418db |
--
|
|
|
2418db |
2.1.4
|
|
|
2418db |
|