[poppler] poppler/Annot.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Fri Sep 8 16:28:48 UTC 2017


 poppler/Annot.cc |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 2532df6060092e9fab7f041ae9598aff9cdd94bb
Author: Albert Astals Cid <aacid at kde.org>
Date:   Fri Sep 8 18:28:15 2017 +0200

    Annot: Fix crash on broken files
    
    Bug #102601

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;


More information about the poppler mailing list