summaryrefslogtreecommitdiff
path: root/Build/source/libs/xpdf/xpdf-3.02-PATCHES/patch-01-pl1
blob: f203821db3691980fd6d93e3aee99434f37291ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
	Official patch http://www.foolabs.com/xpdf/xpdf-3.02pl1.patch

	Update of xpdfVersion in xpdf-3.02/xpdf/config.h

diff -ur -N xpdf-3.02.orig/xpdf/Stream.cc xpdf-3.02/xpdf/Stream.cc
--- xpdf-3.02.orig/xpdf/Stream.cc	2007-02-27 23:05:52.000000000 +0100
+++ xpdf-3.02/xpdf/Stream.cc	2007-08-01 10:34:31.000000000 +0200
@@ -410,15 +410,13 @@
   ok = gFalse;
 
   nVals = width * nComps;
-  if (width <= 0 || nComps <= 0 || nBits <= 0 ||
-      nComps >= INT_MAX / nBits ||
-      width >= INT_MAX / nComps / nBits ||
-      nVals * nBits + 7 < 0) {
-    return;
-  }
   pixBytes = (nComps * nBits + 7) >> 3;
   rowBytes = ((nVals * nBits + 7) >> 3) + pixBytes;
-  if (rowBytes <= 0) {
+  if (width <= 0 || nComps <= 0 || nBits <= 0 ||
+      nComps > gfxColorMaxComps ||
+      nBits > 16 ||
+      width >= INT_MAX / nComps ||      // check for overflow in nVals 
+      nVals >= (INT_MAX - 7) / nBits) { // check for overflow in rowBytes
     return;
   }
   predLine = (Guchar *)gmalloc(rowBytes);
diff -ur -N xpdf-3.02.orig/xpdf/config.h xpdf-3.02/xpdf/config.h
--- xpdf-3.02.orig/xpdf/config.h	2007-02-27 23:05:52.000000000 +0100
+++ xpdf-3.02/xpdf/config.h	2007-08-01 10:34:31.000000000 +0200
@@ -5,6 +5,9 @@
 // Copyright 1996-2007 Glyph & Cog, LLC
 //
 //========================================================================
+//  Modified for TeX Live by Peter Breitenlohner <tex-live@tug.org>
+//  See top-level ChangeLog for a list of all modifications
+//========================================================================
 
 #ifndef CONFIG_H
 #define CONFIG_H
@@ -14,7 +17,7 @@
 //------------------------------------------------------------------------
 
 // xpdf version
-#define xpdfVersion          "3.02"
+#define xpdfVersion          "3.02pl1"
 #define xpdfVersionNum       3.02
 #define xpdfMajorVersion     3
 #define xpdfMinorVersion     2