Commit 9068ee6b952bb79395bc54cfe8331b5aa46eafca

Authored by m-holger
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,12 +545,12 @@ Dictionary
545 Lin::readHintStream(Pipeline& pl, qpdf_offset_t offset, size_t length) 545 Lin::readHintStream(Pipeline& pl, qpdf_offset_t offset, size_t length)
546 { 546 {
547 auto H = m->objects.readObjectAtOffset(offset, "linearization hint stream", false); 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 no_ci_stop_if( 548 no_ci_stop_if(
552 !H.isStream(), "hint table is not a stream", "linearization dictionary" // 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 Dictionary Hdict = H.getDict(); 555 Dictionary Hdict = H.getDict();
556 556