5a404e4
From 170fe21144d469d3f865eda6e298df440b784499 Mon Sep 17 00:00:00 2001
5a404e4
From: Albert Astals Cid <aacid@kde.org>
5a404e4
Date: Fri, 8 Sep 2017 18:28:15 +0200
5a404e4
Subject: [PATCH 2/3] Annot: Fix crash on broken files
5a404e4
5a404e4
Bug #102601
5a404e4
5a404e4
(cherry picked from commit 2532df6060092e9fab7f041ae9598aff9cdd94bb)
5a404e4
---
5a404e4
 poppler/Annot.cc | 6 +++---
5a404e4
 1 file changed, 3 insertions(+), 3 deletions(-)
5a404e4
5a404e4
diff --git a/poppler/Annot.cc b/poppler/Annot.cc
5a404e4
index 27b698db..643ff12c 100644
5a404e4
--- a/poppler/Annot.cc
5a404e4
+++ b/poppler/Annot.cc
5a404e4
@@ -6865,13 +6865,13 @@ AnnotRichMedia::Content::Content(Dict *dict) {
5a404e4
       assets = (Asset **)gmallocn(nAssets, sizeof(Asset *));
5a404e4
 
5a404e4
       int counter = 0;
5a404e4
-      for (int i = 0; i < obj2.arrayGetLength(); i += 2) {
5a404e4
+      for (int i = 0; i < nAssets; ++i) {
5a404e4
         Object objKey;
5a404e4
 
5a404e4
         assets[counter] = new AnnotRichMedia::Asset;
5a404e4
 
5a404e4
-        obj2.arrayGet(i, &objKey);
5a404e4
-        obj2.arrayGet(i + 1, &assets[counter]->fileSpec);
5a404e4
+        obj2.arrayGet(i * 2, &objKey);
5a404e4
+        obj2.arrayGet(i * 2 + 1, &assets[counter]->fileSpec);
5a404e4
 
5a404e4
         assets[counter]->name = new GooString( objKey.getString() );
5a404e4
         ++counter;
5a404e4
-- 
5a404e4
2.14.1
5a404e4