[poppler] PATCH for crash in Page::removeAnnot

Fabio D'Urso fabiodurso at hotmail.it
Wed Jun 26 14:41:45 PDT 2013


The attached patch fixes a crash in Page::removeAnnot, which blindly assumes 
/Annots only contains Ref objects. Some PDF creators embed links (which are 
Dictionaries) in the /Annots array, and this makes us abort() with

Error (0): Call to Object where the object was type 7, not the expected type 9

when we stumble on such a link.

This patch adds a check to skip non-Ref entries (regular annotations *are* Ref 
entries).

Test document (recycled from another bug, turns out it wasn't that useless :D)
 https://bugs.freedesktop.org/attachment.cgi?id=63393&action=edit

Steps to reproduce:
 1. Open the document
 2. Add new annotation
 3. Remove it
 4. abort() gets called

Thanks,
Fabio
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Do-not-crash-in-page-removeAnnot-if-there-are-non-Re.patch
Type: text/x-patch
Size: 1088 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/poppler/attachments/20130626/5c0c8abe/attachment.bin>


More information about the poppler mailing list