Commit d946ad6c3076073b9950df2ee25304c2d2a999ad
1 parent
20ca1e86
In Pl_TIFFPredictor::processRow buffer output
Showing
2 changed files
with
4 additions
and
2 deletions
libqpdf/Pl_TIFFPredictor.cc
| @@ -78,6 +78,7 @@ Pl_TIFFPredictor::processRow() | @@ -78,6 +78,7 @@ Pl_TIFFPredictor::processRow() | ||
| 78 | } | 78 | } |
| 79 | bw.flush(); | 79 | bw.flush(); |
| 80 | } else { | 80 | } else { |
| 81 | + out.clear(); | ||
| 81 | auto next = cur_row.begin(); | 82 | auto next = cur_row.begin(); |
| 82 | auto cr_end = cur_row.end(); | 83 | auto cr_end = cur_row.end(); |
| 83 | auto pr_end = previous.end(); | 84 | auto pr_end = previous.end(); |
| @@ -93,10 +94,10 @@ Pl_TIFFPredictor::processRow() | @@ -93,10 +94,10 @@ Pl_TIFFPredictor::processRow() | ||
| 93 | new_sample += *prev; | 94 | new_sample += *prev; |
| 94 | *prev = new_sample; | 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,6 +35,7 @@ class Pl_TIFFPredictor: public Pipeline | ||
| 35 | unsigned int bits_per_sample; | 35 | unsigned int bits_per_sample; |
| 36 | std::vector<unsigned char> cur_row; | 36 | std::vector<unsigned char> cur_row; |
| 37 | std::vector<long long> previous; | 37 | std::vector<long long> previous; |
| 38 | + std::vector<unsigned char> out; | ||
| 38 | Pipeline* p_next; | 39 | Pipeline* p_next; |
| 39 | }; | 40 | }; |
| 40 | 41 |