[Poppler-bugs] [Bug 105759] [Patch] Add support for next Actions in PDF Forms

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sat Apr 7 09:39:21 UTC 2018


https://bugs.freedesktop.org/show_bug.cgi?id=105759

--- Comment #1 from Albert Astals Cid <aacid at kde.org> ---
This is one of those cases where malformed PDF can loop poppler forever
creating a loop in the Next array by using an Array of references to dicts,
i.e. something like (non valid PDF syntax for sure )
  1 0 obj Dict Link
  stuff
  /Next [ 1 0 R ]
  stuff

This would end up in a parsing loop, and it's worse the loop can be introduced
at any time

  1 0 obj Dict Link
  stuff
  /Next [ 2 0 R ]
  stuff

  2 0 obj Dict Link
  stuff
  /Next [ 1 0 R ]
  stuff

So what we need to do is something similar to what we do in other cases an
std::set<int> seen that we pass to the parseAction, then when parsing the array
call getNF, if it's a ref check/add it against seen, if it's a dict, just carry
on and if it's a ref and not seen before fetch it and carry on too.

If you grep for std::set you'll find some cases around the code that deal with
that.

I wish we had a generic way to do it since it's kind of cumbersome to do every
time we're parsing a tree of objects of the same type :/

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/poppler-bugs/attachments/20180407/829e358a/attachment-0001.html>


More information about the Poppler-bugs mailing list