diff options
author | Albert Astals Cid <aacid@kde.org> | 2017-06-20 23:58:26 +0200 |
---|---|---|
committer | Albert Astals Cid <aacid@kde.org> | 2017-06-21 22:31:19 +0200 |
commit | 5266fa426d73c5dbdb3dd903d50885097833acc6 (patch) | |
tree | 18ce838ac8a52ed6f403f5d3df38069604d4299d | |
parent | 112b8ab16128c6e7f80fe7c1890f7b63abd85cce (diff) |
Fix crash in malformed document
Bug #101526
-rw-r--r-- | poppler/Stream.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/poppler/Stream.cc b/poppler/Stream.cc index 4ac91078..d93c560e 100644 --- a/poppler/Stream.cc +++ b/poppler/Stream.cc @@ -468,7 +468,7 @@ ImageStream::ImageStream(Stream *strA, int widthA, int nCompsA, int nBitsA) { nVals = width * nComps; inputLineSize = (nVals * nBits + 7) >> 3; - if (nBits <= 0 || nVals > INT_MAX / nBits - 7 || width > INT_MAX / nComps) { + if (nComps <= 0 || nBits <= 0 || nVals > INT_MAX / nBits - 7 || width > INT_MAX / nComps) { inputLineSize = -1; } inputLine = (Guchar *)gmallocn_checkoverflow(inputLineSize, sizeof(char)); |