Commit 75a3ef18bce817bd3fc06ad93117776f03ff390d

Authored by m-holger
Committed by GitHub
2 parents faab5274 87e4c7bd

Merge pull request #1621 from m-holger/i1620

Fix field traversal in `AcroForm::transformAnnotations`: replace iter…
libqpdf/QPDFAcroFormDocumentHelper.cc
... ... @@ -955,8 +955,8 @@ AcroForm::transformAnnotations(
955 955 auto traverse_field = [&](QPDFObjectHandle& top_field) -> void {
956 956 std::deque<Dictionary> queue({top_field});
957 957 QPDFObjGen::set seen;
958   - for (auto it = queue.begin(); it != queue.end(); ++it) {
959   - auto& obj = *it;
  958 + for (; !queue.empty(); queue.pop_front()) {
  959 + auto& obj = queue.front();
960 960 if (seen.add(obj)) {
961 961 Dictionary parent = obj["/Parent"];
962 962 if (parent.indirect()) {
... ...