[poppler] poppler/Stream.cc
Albert Astals Cid
aacid at kemper.freedesktop.org
Tue Jun 12 07:34:56 UTC 2018
poppler/Stream.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit e4f4cbddd11ae6386985879187007fa5add43624
Author: Albert Astals Cid <aacid at kde.org>
Date: Tue Jun 12 09:32:57 2018 +0200
StreamPredictor: Move pixBytes calculation after checks
fixes oss-fuzz/8835
diff --git a/poppler/Stream.cc b/poppler/Stream.cc
index 5e5eb335..21bd3b9b 100644
--- a/poppler/Stream.cc
+++ b/poppler/Stream.cc
@@ -572,7 +572,6 @@ StreamPredictor::StreamPredictor(Stream *strA, int predictorA,
ok = gFalse;
nVals = width * nComps;
- pixBytes = (nComps * nBits + 7) >> 3;
if (width <= 0 || nComps <= 0 || nBits <= 0 ||
nComps > gfxColorMaxComps ||
nBits > 16 ||
@@ -580,6 +579,7 @@ StreamPredictor::StreamPredictor(Stream *strA, int predictorA,
nVals >= (INT_MAX - 7) / nBits) { // check for overflow in rowBytes
return;
}
+ pixBytes = (nComps * nBits + 7) >> 3;
rowBytes = ((nVals * nBits + 7) >> 3) + pixBytes;
predLine = (Guchar *)gmalloc(rowBytes);
memset(predLine, 0, rowBytes);
More information about the poppler
mailing list