diff options
Diffstat (limited to 'kpdf/xpdf/xpdf/Stream.cc')
-rw-r--r-- | kpdf/xpdf/xpdf/Stream.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/kpdf/xpdf/xpdf/Stream.cc b/kpdf/xpdf/xpdf/Stream.cc index 20219522..2c1db5b4 100644 --- a/kpdf/xpdf/xpdf/Stream.cc +++ b/kpdf/xpdf/xpdf/Stream.cc @@ -323,6 +323,10 @@ ImageStream::ImageStream(Stream *strA, int widthA, int nCompsA, int nBitsA) { } else { imgLineSize = nVals; } + if (width > INT_MAX / nComps) { + // force a call to gmallocn(-1,...), which will throw an exception + imgLineSize = -1; + } imgLine = (Guchar *)gmallocn(imgLineSize, sizeof(Guchar)); imgIdx = nVals; } |