2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-11-15 17:17:08 +00:00

Pl_PNGFilter: disallow columns = 0

This commit is contained in:
Jay Berkenbilt 2017-08-29 12:27:44 -04:00
parent 6d46346eb9
commit 742190bd98

View File

@ -14,6 +14,10 @@ Pl_PNGFilter::Pl_PNGFilter(char const* identifier, Pipeline* next,
buf2(0), buf2(0),
pos(0) pos(0)
{ {
if (columns == 0)
{
throw std::runtime_error("PNGFilter created with columns = 0");
}
this->buf1 = new unsigned char[columns + 1]; this->buf1 = new unsigned char[columns + 1];
this->buf2 = new unsigned char[columns + 1]; this->buf2 = new unsigned char[columns + 1];
this->cur_row = buf1; this->cur_row = buf1;