Commit 87e4c7bd8e4d8a8d19c2571068cdfba01f54c2dd
1 parent
faab5274
Fix field traversal in `AcroForm::transformAnnotations`: replace iterator with `front`/`pop_front`
Fixes #1620
Showing
1 changed file
with
2 additions
and
2 deletions
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()) { | ... | ... |