aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/Pl_PNGFilter.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2017-08-29 18:27:44 +0200
committerJay Berkenbilt <ejb@ql.org>2017-08-29 18:28:32 +0200
commit742190bd98c0981a07cb39a8eae1e99d909ad5ae (patch)
tree816d71a3f35e64c16c83dae4bc0c863e51723c70 /libqpdf/Pl_PNGFilter.cc
parent6d46346eb93d5032c08cf1e39023b5d57260a766 (diff)
downloadqpdf-742190bd98c0981a07cb39a8eae1e99d909ad5ae.tar.zst
Pl_PNGFilter: disallow columns = 0
Diffstat (limited to 'libqpdf/Pl_PNGFilter.cc')
-rw-r--r--libqpdf/Pl_PNGFilter.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/libqpdf/Pl_PNGFilter.cc b/libqpdf/Pl_PNGFilter.cc
index 4b79e6b1..1566c8a5 100644
--- a/libqpdf/Pl_PNGFilter.cc
+++ b/libqpdf/Pl_PNGFilter.cc
@@ -14,6 +14,10 @@ Pl_PNGFilter::Pl_PNGFilter(char const* identifier, Pipeline* next,
buf2(0),
pos(0)
{
+ if (columns == 0)
+ {
+ throw std::runtime_error("PNGFilter created with columns = 0");
+ }
this->buf1 = new unsigned char[columns + 1];
this->buf2 = new unsigned char[columns + 1];
this->cur_row = buf1;