[poppler] poppler/Annot.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Mon Feb 13 19:48:53 UTC 2017


 poppler/Annot.cc |   31 ++++++++++++++-----------------
 1 file changed, 14 insertions(+), 17 deletions(-)

New commits:
commit 83d4d3ee56b22ef4c0899514abcfc4c220fb4031
Author: Albert Astals Cid <aacid at kde.org>
Date:   Mon Feb 13 20:47:05 2017 +0100

    Properly initialize some RichMedia variables in corner cases
    
    Bug #99767

diff --git a/poppler/Annot.cc b/poppler/Annot.cc
index 51a80e5..9da79c2 100644
--- a/poppler/Annot.cc
+++ b/poppler/Annot.cc
@@ -6854,6 +6854,8 @@ AnnotRichMedia::Content::Content(Dict *dict) {
   }
   obj1.free();
 
+  nAssets = 0;
+  assets = NULL;
   if (dict->lookup("Assets", &obj1)->isDict()) {
     Object obj2;
 
@@ -6878,10 +6880,6 @@ AnnotRichMedia::Content::Content(Dict *dict) {
       }
     }
     obj2.free();
-
-  } else {
-    nAssets = 0;
-    assets = NULL;
   }
   obj1.free();
 }
@@ -7044,20 +7042,19 @@ AnnotRichMedia::Instance::Instance(Dict *dict)
 {
   Object obj1;
 
-  if (dict->lookup("Subtype", &obj1)->isName()) {
-    const char *name = obj1.getName();
+  dict->lookup("Subtype", &obj1);
+  const char *name = obj1.isName() ? obj1.getName() : "";
 
-    if (!strcmp(name, "3D")) {
-      type = type3D;
-    } else if (!strcmp(name, "Flash")) {
-      type = typeFlash;
-    } else if (!strcmp(name, "Sound")) {
-      type = typeSound;
-    } else if (!strcmp(name, "Video")) {
-      type = typeVideo;
-    } else {
-      type = typeFlash;
-    }
+  if (!strcmp(name, "3D")) {
+    type = type3D;
+  } else if (!strcmp(name, "Flash")) {
+    type = typeFlash;
+  } else if (!strcmp(name, "Sound")) {
+    type = typeSound;
+  } else if (!strcmp(name, "Video")) {
+    type = typeVideo;
+  } else {
+    type = typeFlash;
   }
   obj1.free();
 


More information about the poppler mailing list