[poppler] 2 commits - glib/poppler-action.cc glib/poppler-document.cc

Carlos Garcia Campos carlosgc at kemper.freedesktop.org
Sun Sep 12 02:44:31 PDT 2010


 glib/poppler-action.cc   |   15 +++++++++------
 glib/poppler-document.cc |    1 +
 2 files changed, 10 insertions(+), 6 deletions(-)

New commits:
commit 53324502898ae5fbbb21a4fb819e4a84acdc1a64
Author: Carlos Garcia Campos <carlosgc at gnome.org>
Date:   Sun Sep 12 11:42:03 2010 +0200

    [glib] Fix a crash when building layer actions
    
    Some layers are just the parent of others, but not actually a layer so
    they don't have an optional content object. Fixes bug #30106.

diff --git a/glib/poppler-action.cc b/glib/poppler-action.cc
index c076551..bcb2d36 100644
--- a/glib/poppler-action.cc
+++ b/glib/poppler-action.cc
@@ -533,14 +533,17 @@ get_layer_for_ref (PopplerDocument *document,
 
 	for (l = layers; l; l = g_list_next (l)) {
 		Layer *layer = (Layer *)l->data;
-		Ref ocgRef = layer->oc->getRef();
 
-		if (ref->num == ocgRef.num && ref->gen == ocgRef.gen) {
-			GList *rb_group = NULL;
+		if (layer->oc) {
+			Ref ocgRef = layer->oc->getRef();
 
-			if (preserve_rb)
-				rb_group = _poppler_document_get_layer_rbgroup (document, layer);
-			return _poppler_layer_new (document, layer, rb_group);
+			if (ref->num == ocgRef.num && ref->gen == ocgRef.gen) {
+				GList *rb_group = NULL;
+
+				if (preserve_rb)
+					rb_group = _poppler_document_get_layer_rbgroup (document, layer);
+				return _poppler_layer_new (document, layer, rb_group);
+			}
 		}
 
 		if (layer->kids) {
commit dfc6ea7877635212aa7c5f7ade07af4aa9467e96
Author: Carlos Garcia Campos <carlosgc at gnome.org>
Date:   Sun Sep 12 11:36:58 2010 +0200

    [glib] Fix layers array generation when it contains multiple arrays
    
    Fixes layers for document attached to bug #30106.

diff --git a/glib/poppler-document.cc b/glib/poppler-document.cc
index 680c8de..2762881 100644
--- a/glib/poppler-document.cc
+++ b/glib/poppler-document.cc
@@ -1646,6 +1646,7 @@ get_optional_content_items_sorted (OCGs *ocg, Layer *parent, Array *order)
 	items = g_list_prepend (items, last_item);
       }
       last_item->kids = get_optional_content_items_sorted (ocg, last_item, orderItem.getArray ());
+      last_item = NULL;
     } else if (orderItem.isString ()) {
       last_item->label = _poppler_goo_string_to_utf8 (orderItem.getString ());
     }


More information about the poppler mailing list