aboutsummaryrefslogtreecommitdiff
path: root/graphics/kdegraphics3/files/patch-post-3.5.7-kdegraphics-CVE-2007-3387.diff
blob: e28add87e2757b2b2aeb333ed9254a9b787f9988 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Index: kpdf/xpdf/xpdf/Stream.cc
===================================================================
--- kpdf/xpdf/xpdf/Stream.cc	(revision 689574)
+++ kpdf/xpdf/xpdf/Stream.cc	(working copy)
@@ -411,9 +411,9 @@ StreamPredictor::StreamPredictor(Stream 
 
   nVals = width * nComps;
   if (width <= 0 || nComps <= 0 || nBits <= 0 ||
-      nComps >= INT_MAX / nBits ||
-      width >= INT_MAX / nComps / nBits ||
-      nVals * nBits + 7 < 0) {
+      nComps > gfxColorMaxComps || nBits > 16 ||
+      width >= INT_MAX / nComps ||
+      nVals >= (INT_MAX - 7) / nBits) {
     return;
   }
   pixBytes = (nComps * nBits + 7) >> 3;