From 742190bd98c0981a07cb39a8eae1e99d909ad5ae Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Tue, 29 Aug 2017 12:27:44 -0400 Subject: [PATCH] Pl_PNGFilter: disallow columns = 0 --- libqpdf/Pl_PNGFilter.cc | 4 ++++ 1 file changed, 4 insertions(+) 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;