mirror of https://github.com/qpdf/qpdf.git
In Pl_TIFFPredictor::processRow buffer output
This commit is contained in:
parent
20ca1e8644
commit
d946ad6c30
|
@ -78,6 +78,7 @@ Pl_TIFFPredictor::processRow()
|
||||||
}
|
}
|
||||||
bw.flush();
|
bw.flush();
|
||||||
} else {
|
} else {
|
||||||
|
out.clear();
|
||||||
auto next = cur_row.begin();
|
auto next = cur_row.begin();
|
||||||
auto cr_end = cur_row.end();
|
auto cr_end = cur_row.end();
|
||||||
auto pr_end = previous.end();
|
auto pr_end = previous.end();
|
||||||
|
@ -93,10 +94,10 @@ Pl_TIFFPredictor::processRow()
|
||||||
new_sample += *prev;
|
new_sample += *prev;
|
||||||
*prev = new_sample;
|
*prev = new_sample;
|
||||||
}
|
}
|
||||||
auto out = static_cast<unsigned char>(255U & new_sample);
|
out.push_back(static_cast<unsigned char>(255U & new_sample));
|
||||||
p_next->write(&out, 1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
p_next->write(out.data(), out.size());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,7 @@ class Pl_TIFFPredictor: public Pipeline
|
||||||
unsigned int bits_per_sample;
|
unsigned int bits_per_sample;
|
||||||
std::vector<unsigned char> cur_row;
|
std::vector<unsigned char> cur_row;
|
||||||
std::vector<long long> previous;
|
std::vector<long long> previous;
|
||||||
|
std::vector<unsigned char> out;
|
||||||
Pipeline* p_next;
|
Pipeline* p_next;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue