<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [Patch] Add support for next Actions in PDF Forms"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=105759#c1">Comment # 1</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [Patch] Add support for next Actions in PDF Forms"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=105759">bug 105759</a>
              from <span class="vcard"><a class="email" href="mailto:aacid@kde.org" title="Albert Astals Cid <aacid@kde.org>"> <span class="fn">Albert Astals Cid</span></a>
</span></b>
        <pre>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 :/</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>