From b7abb12f55ec2bd45eb8b20c2c058395c289111b Mon Sep 17 00:00:00 2001 From: m-holger Date: Fri, 26 Jan 2024 20:56:21 +0000 Subject: [PATCH] In Pl_TIFFPredictor::processRow remove special case for first column --- libqpdf/Pl_TIFFPredictor.cc | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/libqpdf/Pl_TIFFPredictor.cc b/libqpdf/Pl_TIFFPredictor.cc index 8820f4bc..5454d13a 100644 --- a/libqpdf/Pl_TIFFPredictor.cc +++ b/libqpdf/Pl_TIFFPredictor.cc @@ -6,8 +6,6 @@ #include #include -#include -#include Pl_TIFFPredictor::Pl_TIFFPredictor( char const* identifier, @@ -62,14 +60,9 @@ Pl_TIFFPredictor::processRow() QTC::TC("libtests", "Pl_TIFFPredictor processRow", (action == a_decode ? 0 : 1)); BitWriter bw(p_next); BitStream in(cur_row.data(), cur_row.size()); - previous.clear(); - for (unsigned int i = 0; i < this->samples_per_pixel; ++i) { - long long sample = in.getBitsSigned(this->bits_per_sample); - bw.writeBitsSigned(sample, this->bits_per_sample); - previous.push_back(sample); - } - for (unsigned int col = 1; col < this->columns; ++col) { - for (auto& prev : previous) { + previous.assign(samples_per_pixel, 0); + for (unsigned int col = 0; col < this->columns; ++col) { + for (auto& prev: previous) { long long sample = in.getBitsSigned(this->bits_per_sample); long long new_sample = sample; if (action == a_encode) {