poppler/Stream.cc |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e4f4cbddd11ae6386985879187007fa5add43624
Author: Albert Astals Cid <aa...@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);
_______________________________________________
poppler mailing list
poppler@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/poppler

Reply via email to