summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2017-02-13 20:47:05 +0100
committerAlbert Astals Cid <aacid@kde.org>2017-02-13 20:47:05 +0100
commit83d4d3ee56b22ef4c0899514abcfc4c220fb4031 (patch)
tree186aa282a8866a477ba1f6810bf5a44700fe4082
parent8de4b3595a80d8880b842599cb25ab5fd5367689 (diff)
Properly initialize some RichMedia variables in corner cases
Bug #99767
-rw-r--r--poppler/Annot.cc31
1 files changed, 14 insertions, 17 deletions
diff --git a/poppler/Annot.cc b/poppler/Annot.cc
index 51a80e5d..9da79c24 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();