summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2017-09-08 18:28:15 +0200
committerAlbert Astals Cid <aacid@kde.org>2017-09-08 18:28:15 +0200
commit2532df6060092e9fab7f041ae9598aff9cdd94bb (patch)
tree9cb5459aa48e5eaf7f75f9e884c75b2ead82fd10
parent6472d8493f7e82cc78b41da20a2bf19fcb4e0a7d (diff)
Annot: Fix crash on broken files
Bug #102601
-rw-r--r--poppler/Annot.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/poppler/Annot.cc b/poppler/Annot.cc
index 57d198a9..17043044 100644
--- a/poppler/Annot.cc
+++ b/poppler/Annot.cc
@@ -6559,11 +6559,11 @@ AnnotRichMedia::Content::Content(Dict *dict) {
assets = (Asset **)gmallocn(nAssets, sizeof(Asset *));
int counter = 0;
- for (int i = 0; i < obj2.arrayGetLength(); i += 2) {
+ for (int i = 0; i < nAssets; ++i) {
assets[counter] = new AnnotRichMedia::Asset;
- Object objKey = obj2.arrayGet(i);
- assets[counter]->fileSpec = obj2.arrayGet(i + 1);
+ Object objKey = obj2.arrayGet(i * 2);
+ assets[counter]->fileSpec = obj2.arrayGet(i * 2 + 1);
assets[counter]->name = new GooString( objKey.getString() );
++counter;