From 2532df6060092e9fab7f041ae9598aff9cdd94bb Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Fri, 8 Sep 2017 18:28:15 +0200 Subject: Annot: Fix crash on broken files Bug #102601 --- poppler/Annot.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'poppler/Annot.cc') 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; -- cgit v1.2.3