mirror of
https://github.com/qpdf/qpdf.git
synced 2025-01-03 07:12:28 +00:00
Use QPDFObjGen::set in QPDF::getCompressibleObjGens
This commit is contained in:
parent
53f6c0a55a
commit
aeb66311c2
@ -2511,7 +2511,7 @@ QPDF::getCompressibleObjGens()
|
|||||||
QPDFObjectHandle encryption_dict = this->m->trailer.getKey("/Encrypt");
|
QPDFObjectHandle encryption_dict = this->m->trailer.getKey("/Encrypt");
|
||||||
QPDFObjGen encryption_dict_og = encryption_dict.getObjGen();
|
QPDFObjGen encryption_dict_og = encryption_dict.getObjGen();
|
||||||
|
|
||||||
std::set<QPDFObjGen> visited;
|
QPDFObjGen::set visited;
|
||||||
std::list<QPDFObjectHandle> queue;
|
std::list<QPDFObjectHandle> queue;
|
||||||
queue.push_front(this->m->trailer);
|
queue.push_front(this->m->trailer);
|
||||||
std::vector<QPDFObjGen> result;
|
std::vector<QPDFObjGen> result;
|
||||||
@ -2520,7 +2520,7 @@ QPDF::getCompressibleObjGens()
|
|||||||
queue.pop_front();
|
queue.pop_front();
|
||||||
if (obj.isIndirect()) {
|
if (obj.isIndirect()) {
|
||||||
QPDFObjGen og = obj.getObjGen();
|
QPDFObjGen og = obj.getObjGen();
|
||||||
if (visited.count(og)) {
|
if (!visited.add(og)) {
|
||||||
QTC::TC("qpdf", "QPDF loop detected traversing objects");
|
QTC::TC("qpdf", "QPDF loop detected traversing objects");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -2532,7 +2532,6 @@ QPDF::getCompressibleObjGens()
|
|||||||
obj.hasKey("/Contents")))) {
|
obj.hasKey("/Contents")))) {
|
||||||
result.push_back(og);
|
result.push_back(og);
|
||||||
}
|
}
|
||||||
visited.insert(og);
|
|
||||||
}
|
}
|
||||||
if (obj.isStream()) {
|
if (obj.isStream()) {
|
||||||
QPDFObjectHandle dict = obj.getDict();
|
QPDFObjectHandle dict = obj.getDict();
|
||||||
|
Loading…
Reference in New Issue
Block a user