diff options
Diffstat (limited to 'libqpdf')
-rw-r--r-- | libqpdf/BufferInputSource.cc | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/libqpdf/BufferInputSource.cc b/libqpdf/BufferInputSource.cc index fb4010ef..9e9b4c17 100644 --- a/libqpdf/BufferInputSource.cc +++ b/libqpdf/BufferInputSource.cc @@ -102,21 +102,6 @@ BufferInputSource::tell() } void -BufferInputSource::range_check(qpdf_offset_t cur, qpdf_offset_t delta) -{ - if ((delta > 0) && - ((std::numeric_limits<qpdf_offset_t>::max() - cur) < delta)) - { - std::ostringstream msg; - msg.imbue(std::locale::classic()); - msg << "seeking forward from " << cur - << " by " << delta - << " would cause an overflow of the offset type"; - throw std::range_error(msg.str()); - } -} - -void BufferInputSource::seek(qpdf_offset_t offset, int whence) { switch (whence) @@ -126,12 +111,12 @@ BufferInputSource::seek(qpdf_offset_t offset, int whence) break; case SEEK_END: - range_check(this->m->max_offset, offset); + QIntC::range_check(this->m->max_offset, offset); this->m->cur_offset = this->m->max_offset + offset; break; case SEEK_CUR: - range_check(this->m->cur_offset, offset); + QIntC::range_check(this->m->cur_offset, offset); this->m->cur_offset += offset; break; |