diff options
-rw-r--r-- | libqpdf/Pl_PNGFilter.cc | 10 | ||||
-rw-r--r-- | libqpdf/Pl_RC4.cc | 3 | ||||
-rw-r--r-- | libqpdf/Pl_TIFFPredictor.cc | 6 | ||||
-rw-r--r-- | libqpdf/QUtil.cc | 2 |
4 files changed, 12 insertions, 9 deletions
diff --git a/libqpdf/Pl_PNGFilter.cc b/libqpdf/Pl_PNGFilter.cc index 5f2ae54d..b9aa6b2b 100644 --- a/libqpdf/Pl_PNGFilter.cc +++ b/libqpdf/Pl_PNGFilter.cc @@ -1,6 +1,8 @@ #include <qpdf/Pl_PNGFilter.hh> #include <qpdf/QTC.hh> +#include <qpdf/QUtil.hh> + #include <stdexcept> #include <string.h> #include <limits.h> @@ -46,10 +48,10 @@ Pl_PNGFilter::Pl_PNGFilter(char const* identifier, Pipeline* next, "PNGFilter created with invalid columns value"); } this->bytes_per_row = bpr & UINT_MAX; - this->buf1 = PointerHolder<unsigned char>( - true, new unsigned char[this->bytes_per_row + 1]); - this->buf2 = PointerHolder<unsigned char>( - true, new unsigned char[this->bytes_per_row + 1]); + this->buf1 = make_array_pointer_holder<unsigned char>( + this->bytes_per_row + 1); + this->buf2 = make_array_pointer_holder<unsigned char>( + this->bytes_per_row + 1); memset(this->buf1.get(), 0, this->bytes_per_row + 1); memset(this->buf2.get(), 0, this->bytes_per_row + 1); this->cur_row = this->buf1.get(); diff --git a/libqpdf/Pl_RC4.cc b/libqpdf/Pl_RC4.cc index 8e3548e5..26d9303f 100644 --- a/libqpdf/Pl_RC4.cc +++ b/libqpdf/Pl_RC4.cc @@ -9,8 +9,7 @@ Pl_RC4::Pl_RC4(char const* identifier, Pipeline* next, out_bufsize(out_bufsize), rc4(key_data, key_len) { - this->outbuf = PointerHolder<unsigned char>( - true, new unsigned char[out_bufsize]); + this->outbuf = make_array_pointer_holder<unsigned char>(out_bufsize); } Pl_RC4::~Pl_RC4() diff --git a/libqpdf/Pl_TIFFPredictor.cc b/libqpdf/Pl_TIFFPredictor.cc index 3facfec2..5705eca3 100644 --- a/libqpdf/Pl_TIFFPredictor.cc +++ b/libqpdf/Pl_TIFFPredictor.cc @@ -3,6 +3,8 @@ #include <qpdf/QTC.hh> #include <qpdf/BitStream.hh> #include <qpdf/BitWriter.hh> +#include <qpdf/QUtil.hh> + #include <stdexcept> #include <vector> #include <string.h> @@ -38,8 +40,8 @@ Pl_TIFFPredictor::Pl_TIFFPredictor(char const* identifier, Pipeline* next, "TIFFPredictor created with invalid columns value"); } this->bytes_per_row = bpr & UINT_MAX; - this->cur_row = PointerHolder<unsigned char>( - true, new unsigned char[this->bytes_per_row]); + this->cur_row = make_array_pointer_holder<unsigned char>( + this->bytes_per_row); memset(this->cur_row.get(), 0, this->bytes_per_row); } diff --git a/libqpdf/QUtil.cc b/libqpdf/QUtil.cc index 1f179fd5..3c90bb90 100644 --- a/libqpdf/QUtil.cc +++ b/libqpdf/QUtil.cc @@ -1269,7 +1269,7 @@ QUtil::read_file_into_memory( fseek(f, 0, SEEK_END); size = QIntC::to_size(QUtil::tell(f)); fseek(f, 0, SEEK_SET); - file_buf = PointerHolder<char>(true, new char[size]); + file_buf = make_array_pointer_holder<char>(size); char* buf_p = file_buf.get(); size_t bytes_read = 0; size_t len = 0; |