Commit d946ad6c3076073b9950df2ee25304c2d2a999ad

Authored by m-holger
1 parent 20ca1e86

In Pl_TIFFPredictor::processRow buffer output

libqpdf/Pl_TIFFPredictor.cc
... ... @@ -78,6 +78,7 @@ Pl_TIFFPredictor::processRow()
78 78 }
79 79 bw.flush();
80 80 } else {
  81 + out.clear();
81 82 auto next = cur_row.begin();
82 83 auto cr_end = cur_row.end();
83 84 auto pr_end = previous.end();
... ... @@ -93,10 +94,10 @@ Pl_TIFFPredictor::processRow()
93 94 new_sample += *prev;
94 95 *prev = new_sample;
95 96 }
96   - auto out = static_cast<unsigned char>(255U & new_sample);
97   - p_next->write(&out, 1);
  97 + out.push_back(static_cast<unsigned char>(255U & new_sample));
98 98 }
99 99 }
  100 + p_next->write(out.data(), out.size());
100 101 }
101 102 }
102 103  
... ...
libqpdf/qpdf/Pl_TIFFPredictor.hh
... ... @@ -35,6 +35,7 @@ class Pl_TIFFPredictor: public Pipeline
35 35 unsigned int bits_per_sample;
36 36 std::vector<unsigned char> cur_row;
37 37 std::vector<long long> previous;
  38 + std::vector<unsigned char> out;
38 39 Pipeline* p_next;
39 40 };
40 41  
... ...