Commit 9068ee6b952bb79395bc54cfe8331b5aa46eafca
1 parent
8767429a
Fix `Lin::readHintStream`
Reorder `no_ci_stop_if` call to avoid insertion of an invalid object into the object cache if the hint stream is invalid
Showing
1 changed file
with
3 additions
and
3 deletions
libqpdf/QPDF_linearization.cc
| ... | ... | @@ -545,12 +545,12 @@ Dictionary |
| 545 | 545 | Lin::readHintStream(Pipeline& pl, qpdf_offset_t offset, size_t length) |
| 546 | 546 | { |
| 547 | 547 | auto H = m->objects.readObjectAtOffset(offset, "linearization hint stream", false); |
| 548 | - ObjCache& oc = m->obj_cache[H]; | |
| 549 | - qpdf_offset_t min_end_offset = oc.end_before_space; | |
| 550 | - qpdf_offset_t max_end_offset = oc.end_after_space; | |
| 551 | 548 | no_ci_stop_if( |
| 552 | 549 | !H.isStream(), "hint table is not a stream", "linearization dictionary" // |
| 553 | 550 | ); |
| 551 | + ObjCache& oc = m->obj_cache[H]; | |
| 552 | + qpdf_offset_t min_end_offset = oc.end_before_space; | |
| 553 | + qpdf_offset_t max_end_offset = oc.end_after_space; | |
| 554 | 554 | |
| 555 | 555 | Dictionary Hdict = H.getDict(); |
| 556 | 556 | ... | ... |