summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Lohrke <carlo@gentoo.org>2005-12-09 20:58:52 +0000
committerCarsten Lohrke <carlo@gentoo.org>2005-12-09 20:58:52 +0000
commit4ac9156e95d976394f158d5f7493d43318846a08 (patch)
tree7d46b29111b6ac8a8e72aae6d0fdf3225c4849af /kde-base
parentVersion bump for xfce-4.2.3.2. (diff)
downloadgentoo-2-4ac9156e95d976394f158d5f7493d43318846a08.tar.gz
gentoo-2-4ac9156e95d976394f158d5f7493d43318846a08.tar.bz2
gentoo-2-4ac9156e95d976394f158d5f7493d43318846a08.zip
fixed patch
(Portage version: 2.0.53)
Diffstat (limited to 'kde-base')
-rw-r--r--kde-base/kpdf/ChangeLog15
-rw-r--r--kde-base/kpdf/Manifest28
-rw-r--r--kde-base/kpdf/files/digest-kpdf-3.4.1-r3 (renamed from kde-base/kpdf/files/digest-kpdf-3.4.1-r2)0
-rw-r--r--kde-base/kpdf/files/digest-kpdf-3.4.3-r2 (renamed from kde-base/kpdf/files/digest-kpdf-3.4.3-r1)0
-rw-r--r--kde-base/kpdf/files/digest-kpdf-3.5.0-r2 (renamed from kde-base/kpdf/files/digest-kpdf-3.5.0-r1)0
-rw-r--r--kde-base/kpdf/files/kpdf-3.4.3-CAN-2005-3193.patch119
-rw-r--r--kde-base/kpdf/files/kpdf-3.5.0-CAN-2005-3193.patch118
-rw-r--r--kde-base/kpdf/files/post-3.4.3-kdegraphics-CAN-2005-3193.diff213
-rw-r--r--kde-base/kpdf/files/post-3.5.0-kdegraphics-CAN-2005-3193.diff155
-rw-r--r--kde-base/kpdf/kpdf-3.4.1-r3.ebuild (renamed from kde-base/kpdf/kpdf-3.4.1-r2.ebuild)4
-rw-r--r--kde-base/kpdf/kpdf-3.4.3-r2.ebuild (renamed from kde-base/kpdf/kpdf-3.4.3-r1.ebuild)6
-rw-r--r--kde-base/kpdf/kpdf-3.5.0-r2.ebuild (renamed from kde-base/kpdf/kpdf-3.5.0-r1.ebuild)4
12 files changed, 398 insertions, 264 deletions
diff --git a/kde-base/kpdf/ChangeLog b/kde-base/kpdf/ChangeLog
index 271edd012039..7d9191b3bb7b 100644
--- a/kde-base/kpdf/ChangeLog
+++ b/kde-base/kpdf/ChangeLog
@@ -1,6 +1,19 @@
# ChangeLog for kde-base/kpdf
# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/kde-base/kpdf/ChangeLog,v 1.45 2005/12/09 05:13:36 josejx Exp $
+# $Header: /var/cvsroot/gentoo-x86/kde-base/kpdf/ChangeLog,v 1.46 2005/12/09 20:58:52 carlo Exp $
+
+*kpdf-3.5.0-r2 (09 Dec 2005)
+*kpdf-3.4.3-r2 (09 Dec 2005)
+*kpdf-3.4.1-r3 (09 Dec 2005)
+
+ 09 Dec 2005; Carsten Lohrke <carlo@gentoo.org>
+ -files/kpdf-3.4.3-CAN-2005-3193.patch,
+ +files/post-3.4.3-kdegraphics-CAN-2005-3193.diff,
+ -files/kpdf-3.5.0-CAN-2005-3193.patch,
+ +files/post-3.5.0-kdegraphics-CAN-2005-3193.diff, -kpdf-3.4.1-r2.ebuild,
+ +kpdf-3.4.1-r3.ebuild, -kpdf-3.4.3-r1.ebuild, +kpdf-3.4.3-r2.ebuild,
+ -kpdf-3.5.0-r1.ebuild, +kpdf-3.5.0-r2.ebuild:
+ fixed patch
09 Dec 2005; Joseph Jezak <josejx@gentoo.org> kpdf-3.4.3.ebuild:
Marked ppc stable for bug #112842.
diff --git a/kde-base/kpdf/Manifest b/kde-base/kpdf/Manifest
index 50e61160d636..040710cdc8c5 100644
--- a/kde-base/kpdf/Manifest
+++ b/kde-base/kpdf/Manifest
@@ -1,38 +1,28 @@
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-
-MD5 25a01604091fcad7730da341d3dd0921 ChangeLog 5931
+MD5 93d1117306b4e2e1f3183ccaee5fcd8d ChangeLog 6411
MD5 1334abaee53983ad0a0810adeafef453 files/digest-kpdf-3.4.1 221
MD5 1334abaee53983ad0a0810adeafef453 files/digest-kpdf-3.4.1-r1 221
-MD5 912bf2607fc0c67f023f6084731eba21 files/digest-kpdf-3.4.1-r2 221
+MD5 912bf2607fc0c67f023f6084731eba21 files/digest-kpdf-3.4.1-r3 221
MD5 cb94e5a98246b8c80e29c3d668e4be9d files/digest-kpdf-3.4.2 300
MD5 cb94e5a98246b8c80e29c3d668e4be9d files/digest-kpdf-3.4.2-r1 300
MD5 cb94e5a98246b8c80e29c3d668e4be9d files/digest-kpdf-3.4.2-r2 300
MD5 ad9f9a5920cdd067ae76d39d768fce5f files/digest-kpdf-3.4.3 71
-MD5 ad9f9a5920cdd067ae76d39d768fce5f files/digest-kpdf-3.4.3-r1 71
+MD5 ad9f9a5920cdd067ae76d39d768fce5f files/digest-kpdf-3.4.3-r2 71
MD5 0459ac16349d79da6246392e2454796b files/digest-kpdf-3.5.0 71
-MD5 0459ac16349d79da6246392e2454796b files/digest-kpdf-3.5.0-r1 71
+MD5 0459ac16349d79da6246392e2454796b files/digest-kpdf-3.5.0-r2 71
MD5 653bd55a1e87c51731d0b0512051774e files/kdegraphics-3.4.2-kpdf-contentcrash.patch 749
MD5 4caddebea4d845abb2de6dbbfe1b979a files/kdegraphics-3.4.2-kpdf-fix.patch 1024
-MD5 a4a2359edd7af28474916f12f99871fb files/kpdf-3.4.3-CAN-2005-3193.patch 3455
-MD5 fb8e3783bd62a0ef7979c10fb6046201 files/kpdf-3.5.0-CAN-2005-3193.patch 3384
MD5 d18efc8eb0bf3e3b54a33cf04cdba3fd files/kpdf-3.5.0-splitter-io.patch 1415
MD5 ec3b95efe9139f4259d6de213fe4b87b files/post-3.4.1-kdegraphics-4.diff 1827
+MD5 a2e4c4878c6637efbbbb4ffd20ae6cc2 files/post-3.4.3-kdegraphics-CAN-2005-3193.diff 6383
+MD5 45bc3c00d76feb234aa5db42da0137e5 files/post-3.5.0-kdegraphics-CAN-2005-3193.diff 4768
MD5 493fdf9a2dc94e56301161f38122b422 kpdf-3.4.1-r1.ebuild 627
-MD5 2c14821b49252784a3be3dcf2f6e29fc kpdf-3.4.1-r2.ebuild 673
+MD5 335f815b9ab56548f8365f674b0e4868 kpdf-3.4.1-r3.ebuild 589
MD5 710200655b097652c4ea66ea6e5931db kpdf-3.4.1.ebuild 569
MD5 da8c7b95896e393c3af5901801f76253 kpdf-3.4.2-r1.ebuild 698
MD5 26ec262357d5acdd4fbe2e83d488e692 kpdf-3.4.2-r2.ebuild 816
MD5 9d42c07d0672b69a347a437c76b5e024 kpdf-3.4.2.ebuild 578
-MD5 66cd52fae520733bd4987a312980147e kpdf-3.4.3-r1.ebuild 635
+MD5 95c5e1bf792e070050efc7d89627b996 kpdf-3.4.3-r2.ebuild 554
MD5 ebc89abef66e42d20df7b64f6e0dc72a kpdf-3.4.3.ebuild 578
-MD5 cc6d38e42e8fbfe20e07805598e357b2 kpdf-3.5.0-r1.ebuild 933
+MD5 bb75ab51fed92fc9e01a15d1bbc1d337 kpdf-3.5.0-r2.ebuild 849
MD5 8d8d7ccc0f707b75e14d22df3c13f6b6 kpdf-3.5.0.ebuild 836
MD5 acc03a4b12bb0433a57e95bd253b9501 metadata.xml 156
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.2 (GNU/Linux)
-
-iD8DBQFDmRKKcsIHjyDViGQRAr7jAJ9seP8A9ItP04jr0gQvn9Kl5ls1pQCg0VIh
-TeDSaFzcqxdoBC1HVB3PWIw=
-=Lvfl
------END PGP SIGNATURE-----
diff --git a/kde-base/kpdf/files/digest-kpdf-3.4.1-r2 b/kde-base/kpdf/files/digest-kpdf-3.4.1-r3
index f853096f677e..f853096f677e 100644
--- a/kde-base/kpdf/files/digest-kpdf-3.4.1-r2
+++ b/kde-base/kpdf/files/digest-kpdf-3.4.1-r3
diff --git a/kde-base/kpdf/files/digest-kpdf-3.4.3-r1 b/kde-base/kpdf/files/digest-kpdf-3.4.3-r2
index 2cb888ba9f29..2cb888ba9f29 100644
--- a/kde-base/kpdf/files/digest-kpdf-3.4.3-r1
+++ b/kde-base/kpdf/files/digest-kpdf-3.4.3-r2
diff --git a/kde-base/kpdf/files/digest-kpdf-3.5.0-r1 b/kde-base/kpdf/files/digest-kpdf-3.5.0-r2
index 44e671a5ef99..44e671a5ef99 100644
--- a/kde-base/kpdf/files/digest-kpdf-3.5.0-r1
+++ b/kde-base/kpdf/files/digest-kpdf-3.5.0-r2
diff --git a/kde-base/kpdf/files/kpdf-3.4.3-CAN-2005-3193.patch b/kde-base/kpdf/files/kpdf-3.4.3-CAN-2005-3193.patch
deleted file mode 100644
index 0999fe01cd4e..000000000000
--- a/kde-base/kpdf/files/kpdf-3.4.3-CAN-2005-3193.patch
+++ /dev/null
@@ -1,119 +0,0 @@
---- kpdf/xpdf/xpdf/JPXStream.cc.orig 2005-12-04 13:01:07.000000000 +0100
-+++ kpdf/xpdf/xpdf/JPXStream.cc 2005-12-04 13:15:44.000000000 +0100
-@@ -666,7 +666,7 @@
- int segType;
- GBool haveSIZ, haveCOD, haveQCD, haveSOT;
- Guint precinctSize, style;
-- Guint segLen, capabilities, comp, i, j, r;
-+ Guint segLen, capabilities, nTiles, comp, i, j, r;
-
- //----- main header
- haveSIZ = haveCOD = haveQCD = haveSOT = gFalse;
-@@ -701,6 +701,13 @@
- / img.xTileSize;
- img.nYTiles = (img.ySize - img.yTileOffset + img.yTileSize - 1)
- / img.yTileSize;
-+ nTiles = img.nXTiles * img.nYTiles;
-+ // check for overflow before allocating memory
-+ if (nTiles == 0 || nTiles / img.nXTiles != img.nYTiles) {
-+ error(getPos(), "Bad tile count in JPX SIZ marker segment");
-+ return gFalse;
-+ }
-+ img.tiles = (JPXTile *)gmalloc(nTiles * sizeof(JPXTile));
- img.tiles = (JPXTile *)gmalloc(img.nXTiles * img.nYTiles *
- sizeof(JPXTile));
- for (i = 0; i < img.nXTiles * img.nYTiles; ++i) {
---- kpdf/xpdf/xpdf/Stream.h.orig 2005-12-04 13:16:13.000000000 +0100
-+++ kpdf/xpdf/xpdf/Stream.h 2005-12-04 13:21:52.000000000 +0100
-@@ -233,6 +233,8 @@
-
- ~StreamPredictor();
-
-+ GBool isOk() { return ok; }
-+
- int lookChar();
- int getChar();
-
-@@ -250,6 +252,7 @@
- int rowBytes; // bytes per line
- Guchar *predLine; // line buffer
- int predIdx; // current index in predLine
-+ GBool ok;
- };
-
- //------------------------------------------------------------------------
---- kpdf/xpdf/xpdf/Stream.cc.orig 2005-12-04 13:23:51.000000000 +0100
-+++ kpdf/xpdf/xpdf/Stream.cc 2005-12-04 13:36:34.000000000 +0100
-@@ -408,18 +408,34 @@
-
- StreamPredictor::StreamPredictor(Stream *strA, int predictorA,
- int widthA, int nCompsA, int nBitsA) {
-+ int totalBits;
-+
- str = strA;
- predictor = predictorA;
- width = widthA;
- nComps = nCompsA;
- nBits = nBitsA;
-+ predLine = NULL;
-+ ok = gFalse;
-+
-
- nVals = width * nComps;
-+ totalBits = nVals * nBits;
-+ if (totalBits == 0 ||
-+ (totalBits / nBits) / nComps != width ||
-+ totalBits + 7 < 0) {
-+ return;
-+ }
- pixBytes = (nComps * nBits + 7) >> 3;
-- rowBytes = ((nVals * nBits + 7) >> 3) + pixBytes;
-+ rowBytes = ((totalBits + 7) >> 3) + pixBytes;
-+ if (rowBytes < 0) {
-+ return;
-+ }
- predLine = (Guchar *)gmalloc(rowBytes);
- memset(predLine, 0, rowBytes);
- predIdx = rowBytes;
-+
-+ ok = gTrue;
- }
-
- StreamPredictor::~StreamPredictor() {
-@@ -1013,6 +1029,10 @@
- FilterStream(strA) {
- if (predictor != 1) {
- pred = new StreamPredictor(this, predictor, columns, colors, bits);
-+ if (!pred->isOk()) {
-+ delete pred;
-+ pred = NULL;
-+ }
- } else {
- pred = NULL;
- }
-@@ -2899,6 +2919,14 @@
- height = read16();
- width = read16();
- numComps = str->getChar();
-+ if (numComps <= 0 || numComps > 4) {
-+ error(getPos(), "Bad number of components in DCT stream", prec);
-+ return gFalse;
-+ }
-+ if (numComps <= 0 || numComps > 4) {
-+ error(getPos(), "Bad number of components in DCT stream", prec);
-+ return gFalse;
-+ }
- if (prec != 8) {
- error(getPos(), "Bad DCT precision %d", prec);
- return gFalse;
-@@ -3258,6 +3286,10 @@
- FilterStream(strA) {
- if (predictor != 1) {
- pred = new StreamPredictor(this, predictor, columns, colors, bits);
-+ if (!pred->isOk()) {
-+ delete pred;
-+ pred = NULL;
-+ }
- } else {
- pred = NULL;
- }
diff --git a/kde-base/kpdf/files/kpdf-3.5.0-CAN-2005-3193.patch b/kde-base/kpdf/files/kpdf-3.5.0-CAN-2005-3193.patch
deleted file mode 100644
index f171b12cf5ce..000000000000
--- a/kde-base/kpdf/files/kpdf-3.5.0-CAN-2005-3193.patch
+++ /dev/null
@@ -1,118 +0,0 @@
---- kpdf/xpdf/xpdf/JPXStream.cc 2005/12/01 22:32:29 484786
-+++ kpdf/xpdf/xpdf/JPXStream.cc 2005/12/01 22:34:41 484787
-@@ -783,7 +783,7 @@
- int segType;
- GBool haveSIZ, haveCOD, haveQCD, haveSOT;
- Guint precinctSize, style;
-- Guint segLen, capabilities, comp, i, j, r;
-+ Guint segLen, capabilities, nTiles, comp, i, j, r;
-
- //----- main header
- haveSIZ = haveCOD = haveQCD = haveSOT = gFalse;
-@@ -818,6 +818,13 @@
- / img.xTileSize;
- img.nYTiles = (img.ySize - img.yTileOffset + img.yTileSize - 1)
- / img.yTileSize;
-+ nTiles = img.nXTiles * img.nYTiles;
-+ // check for overflow before allocating memory
-+ if (nTiles == 0 || nTiles / img.nXTiles != img.nYTiles) {
-+ error(getPos(), "Bad tile count in JPX SIZ marker segment");
-+ return gFalse;
-+ }
-+ img.tiles = (JPXTile *)gmallocn(nTiles, sizeof(JPXTile));
- img.tiles = (JPXTile *)gmallocn(img.nXTiles * img.nYTiles,
- sizeof(JPXTile));
- for (i = 0; i < img.nXTiles * img.nYTiles; ++i) {
---- kpdf/xpdf/xpdf/Stream.h 2005/12/01 22:32:29 484786
-+++ kpdf/xpdf/xpdf/Stream.h 2005/12/01 22:34:41 484787
-@@ -232,6 +232,8 @@
-
- ~StreamPredictor();
-
-+ GBool isOk() { return ok; }
-+
- int lookChar();
- int getChar();
-
-@@ -249,6 +251,7 @@
- int rowBytes; // bytes per line
- Guchar *predLine; // line buffer
- int predIdx; // current index in predLine
-+ GBool ok;
- };
-
- //------------------------------------------------------------------------
---- kpdf/xpdf/xpdf/Stream.cc 2005/12/01 22:32:29 484786
-+++ kpdf/xpdf/xpdf/Stream.cc 2005/12/01 22:34:41 484787
-@@ -403,18 +403,33 @@
-
- StreamPredictor::StreamPredictor(Stream *strA, int predictorA,
- int widthA, int nCompsA, int nBitsA) {
-+ int totalBits;
-+
- str = strA;
- predictor = predictorA;
- width = widthA;
- nComps = nCompsA;
- nBits = nBitsA;
-+ predLine = NULL;
-+ ok = gFalse;
-
- nVals = width * nComps;
-+ totalBits = nVals * nBits;
-+ if (totalBits == 0 ||
-+ (totalBits / nBits) / nComps != width ||
-+ totalBits + 7 < 0) {
-+ return;
-+ }
- pixBytes = (nComps * nBits + 7) >> 3;
-- rowBytes = ((nVals * nBits + 7) >> 3) + pixBytes;
-+ rowBytes = ((totalBits + 7) >> 3) + pixBytes;
-+ if (rowBytes < 0) {
-+ return;
-+ }
- predLine = (Guchar *)gmalloc(rowBytes);
- memset(predLine, 0, rowBytes);
- predIdx = rowBytes;
-+
-+ ok = gTrue;
- }
-
- StreamPredictor::~StreamPredictor() {
-@@ -1006,6 +1021,10 @@
- FilterStream(strA) {
- if (predictor != 1) {
- pred = new StreamPredictor(this, predictor, columns, colors, bits);
-+ if (!pred->isOk()) {
-+ delete pred;
-+ pred = NULL;
-+ }
- } else {
- pred = NULL;
- }
-@@ -2903,6 +2922,14 @@
- height = read16();
- width = read16();
- numComps = str->getChar();
-+ if (numComps <= 0 || numComps > 4) {
-+ error(getPos(), "Bad number of components in DCT stream", prec);
-+ return gFalse;
-+ }
-+ if (numComps <= 0 || numComps > 4) {
-+ error(getPos(), "Bad number of components in DCT stream", prec);
-+ return gFalse;
-+ }
- if (prec != 8) {
- error(getPos(), "Bad DCT precision %d", prec);
- return gFalse;
-@@ -3833,6 +3860,10 @@
- FilterStream(strA) {
- if (predictor != 1) {
- pred = new StreamPredictor(this, predictor, columns, colors, bits);
-+ if (!pred->isOk()) {
-+ delete pred;
-+ pred = NULL;
-+ }
- } else {
- pred = NULL;
- }
diff --git a/kde-base/kpdf/files/post-3.4.3-kdegraphics-CAN-2005-3193.diff b/kde-base/kpdf/files/post-3.4.3-kdegraphics-CAN-2005-3193.diff
new file mode 100644
index 000000000000..c060c4e31324
--- /dev/null
+++ b/kde-base/kpdf/files/post-3.4.3-kdegraphics-CAN-2005-3193.diff
@@ -0,0 +1,213 @@
+Index: kpdf/xpdf/xpdf/Stream.cc
+===================================================================
+--- kpdf/xpdf/xpdf/Stream.cc (revision 486337)
++++ kpdf/xpdf/xpdf/Stream.cc (revision 487206)
+@@ -15,6 +15,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <stddef.h>
++#include <limits.h>
+ #ifndef WIN32
+ #include <unistd.h>
+ #endif
+@@ -413,13 +414,27 @@ StreamPredictor::StreamPredictor(Stream
+ width = widthA;
+ nComps = nCompsA;
+ nBits = nBitsA;
++ predLine = NULL;
++ ok = gFalse;
++
++ if (width <= 0 || nComps <= 0 || nBits <= 0 ||
++ nComps >= INT_MAX / nBits ||
++ width >= INT_MAX / nComps / nBits)
++ return;
+
+ nVals = width * nComps;
++ if (nVals + 7 <= 0)
++ return;
+ pixBytes = (nComps * nBits + 7) >> 3;
+ rowBytes = ((nVals * nBits + 7) >> 3) + pixBytes;
++ if (rowBytes < 0)
++ return;
++
+ predLine = (Guchar *)gmalloc(rowBytes);
+ memset(predLine, 0, rowBytes);
+ predIdx = rowBytes;
++
++ ok = gTrue;
+ }
+
+ StreamPredictor::~StreamPredictor() {
+@@ -1013,6 +1028,10 @@ LZWStream::LZWStream(Stream *strA, int p
+ FilterStream(strA) {
+ if (predictor != 1) {
+ pred = new StreamPredictor(this, predictor, columns, colors, bits);
++ if (!pred->isOk()) {
++ delete pred;
++ pred = NULL;
++ }
+ } else {
+ pred = NULL;
+ }
+@@ -2899,6 +2918,10 @@ GBool DCTStream::readBaselineSOF() {
+ height = read16();
+ width = read16();
+ numComps = str->getChar();
++ if (numComps <= 0 || numComps > 4) {
++ error(getPos(), "Bad number of components in DCT stream");
++ return gFalse;
++ }
+ if (prec != 8) {
+ error(getPos(), "Bad DCT precision %d", prec);
+ return gFalse;
+@@ -2925,6 +2948,10 @@ GBool DCTStream::readProgressiveSOF() {
+ height = read16();
+ width = read16();
+ numComps = str->getChar();
++ if (numComps <= 0 || numComps > 4) {
++ error(getPos(), "Bad number of components in DCT stream");
++ return gFalse;
++ }
+ if (prec != 8) {
+ error(getPos(), "Bad DCT precision %d", prec);
+ return gFalse;
+@@ -2947,6 +2974,10 @@ GBool DCTStream::readScanInfo() {
+
+ length = read16() - 2;
+ scanInfo.numComps = str->getChar();
++ if (scanInfo.numComps <= 0 || scanInfo.numComps > 4) {
++ error(getPos(), "Bad number of components in DCT stream");
++ return gFalse;
++ }
+ --length;
+ if (length != 2 * scanInfo.numComps + 3) {
+ error(getPos(), "Bad DCT scan info block");
+@@ -3258,6 +3289,10 @@ FlateStream::FlateStream(Stream *strA, i
+ FilterStream(strA) {
+ if (predictor != 1) {
+ pred = new StreamPredictor(this, predictor, columns, colors, bits);
++ if (!pred->isOk()) {
++ delete pred;
++ pred = NULL;
++ }
+ } else {
+ pred = NULL;
+ }
+Index: kpdf/xpdf/xpdf/Stream.h
+===================================================================
+--- kpdf/xpdf/xpdf/Stream.h (revision 486337)
++++ kpdf/xpdf/xpdf/Stream.h (revision 487206)
+@@ -233,6 +233,8 @@ public:
+
+ ~StreamPredictor();
+
++ GBool isOk() { return ok; }
++
+ int lookChar();
+ int getChar();
+
+@@ -250,6 +252,7 @@ private:
+ int rowBytes; // bytes per line
+ Guchar *predLine; // line buffer
+ int predIdx; // current index in predLine
++ GBool ok;
+ };
+
+ //------------------------------------------------------------------------
+Index: kpdf/xpdf/xpdf/JPXStream.cc
+===================================================================
+--- kpdf/xpdf/xpdf/JPXStream.cc (revision 486337)
++++ kpdf/xpdf/xpdf/JPXStream.cc (revision 487206)
+@@ -7,6 +7,7 @@
+ //========================================================================
+
+ #include <aconf.h>
++#include <limits.h>
+
+ #ifdef USE_GCC_PRAGMAS
+ #pragma implementation
+@@ -666,7 +667,7 @@ GBool JPXStream::readCodestream(Guint /*
+ int segType;
+ GBool haveSIZ, haveCOD, haveQCD, haveSOT;
+ Guint precinctSize, style;
+- Guint segLen, capabilities, comp, i, j, r;
++ Guint segLen, capabilities, nTiles, comp, i, j, r;
+
+ //----- main header
+ haveSIZ = haveCOD = haveQCD = haveSOT = gFalse;
+@@ -701,8 +702,12 @@ GBool JPXStream::readCodestream(Guint /*
+ / img.xTileSize;
+ img.nYTiles = (img.ySize - img.yTileOffset + img.yTileSize - 1)
+ / img.yTileSize;
+- img.tiles = (JPXTile *)gmalloc(img.nXTiles * img.nYTiles *
+- sizeof(JPXTile));
++ nTiles = img.nXTiles * img.nYTiles;
++ if (img.nXTiles <= 0 || img.nYTiles <= 0 || img.nXTiles >= INT_MAX / img.nYTiles) {
++ error(getPos(), "Bad tile count in JPX SIZ marker segment");
++ return gFalse;
++ }
++ img.tiles = (JPXTile *)gmallocn(nTiles, sizeof(JPXTile));
+ for (i = 0; i < img.nXTiles * img.nYTiles; ++i) {
+ img.tiles[i].tileComps = (JPXTileComp *)gmalloc(img.nComps *
+ sizeof(JPXTileComp));
+Index: kpdf/xpdf/goo/gmem.c
+===================================================================
+--- kpdf/xpdf/goo/gmem.c (revision 486337)
++++ kpdf/xpdf/goo/gmem.c (revision 487206)
+@@ -11,6 +11,7 @@
+ #include <stdlib.h>
+ #include <stddef.h>
+ #include <string.h>
++#include <limits.h>
+ #include "gmem.h"
+
+ #ifdef DEBUG_MEM
+@@ -175,6 +176,28 @@ void gfree(void *p) {
+ #endif
+ }
+
++void *gmallocn(int nObjs, int objSize) {
++ int n;
++
++ n = nObjs * objSize;
++ if (objSize <= 0 || nObjs < 0 || nObjs >= INT_MAX / objSize) {
++ fprintf(stderr, "Bogus memory allocation size\n");
++ exit(1);
++ }
++ return gmalloc(n);
++}
++
++void *greallocn(void *p, int nObjs, int objSize) {
++ int n;
++
++ n = nObjs * objSize;
++ if (objSize <= 0 || nObjs < 0 || nObjs >= INT_MAX / objSize) {
++ fprintf(stderr, "Bogus memory allocation size\n");
++ exit(1);
++ }
++ return grealloc(p, n);
++}
++
+ #ifdef DEBUG_MEM
+ void gMemReport(FILE *f) {
+ GMemHdr *p;
+Index: kpdf/xpdf/goo/gmem.h
+===================================================================
+--- kpdf/xpdf/goo/gmem.h (revision 486337)
++++ kpdf/xpdf/goo/gmem.h (revision 487206)
+@@ -28,6 +28,15 @@ extern void *gmalloc(size_t size);
+ extern void *grealloc(void *p, size_t size);
+
+ /*
++ * These are similar to gmalloc and grealloc, but take an object count
++ * and size. The result is similar to allocating nObjs * objSize
++ * bytes, but there is an additional error check that the total size
++ * doesn't overflow an int.
++ */
++extern void *gmallocn(int nObjs, int objSize);
++extern void *greallocn(void *p, int nObjs, int objSize);
++
++/*
+ * Same as free, but checks for and ignores NULL pointers.
+ */
+ extern void gfree(void *p);
diff --git a/kde-base/kpdf/files/post-3.5.0-kdegraphics-CAN-2005-3193.diff b/kde-base/kpdf/files/post-3.5.0-kdegraphics-CAN-2005-3193.diff
new file mode 100644
index 000000000000..a30fe74a789a
--- /dev/null
+++ b/kde-base/kpdf/files/post-3.5.0-kdegraphics-CAN-2005-3193.diff
@@ -0,0 +1,155 @@
+Index: kpdf/xpdf/xpdf/Stream.cc
+===================================================================
+--- kpdf/xpdf/xpdf/Stream.cc (revision 473213)
++++ kpdf/xpdf/xpdf/Stream.cc (revision 487206)
+@@ -15,6 +15,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <stddef.h>
++#include <limits.h>
+ #ifndef WIN32
+ #include <unistd.h>
+ #endif
+@@ -408,13 +409,27 @@ StreamPredictor::StreamPredictor(Stream
+ width = widthA;
+ nComps = nCompsA;
+ nBits = nBitsA;
++ predLine = NULL;
++ ok = gFalse;
++
++ if (width <= 0 || nComps <= 0 || nBits <= 0 ||
++ nComps >= INT_MAX / nBits ||
++ width >= INT_MAX / nComps / nBits)
++ return;
+
+ nVals = width * nComps;
++ if (nVals + 7 <= 0)
++ return;
+ pixBytes = (nComps * nBits + 7) >> 3;
+ rowBytes = ((nVals * nBits + 7) >> 3) + pixBytes;
++ if (rowBytes < 0)
++ return;
++
+ predLine = (Guchar *)gmalloc(rowBytes);
+ memset(predLine, 0, rowBytes);
+ predIdx = rowBytes;
++
++ ok = gTrue;
+ }
+
+ StreamPredictor::~StreamPredictor() {
+@@ -1006,6 +1021,10 @@ LZWStream::LZWStream(Stream *strA, int p
+ FilterStream(strA) {
+ if (predictor != 1) {
+ pred = new StreamPredictor(this, predictor, columns, colors, bits);
++ if (!pred->isOk()) {
++ delete pred;
++ pred = NULL;
++ }
+ } else {
+ pred = NULL;
+ }
+@@ -2903,7 +2922,11 @@ GBool DCTStream::readBaselineSOF() {
+ height = read16();
+ width = read16();
+ numComps = str->getChar();
+- if (prec != 8) {
++ if (numComps <= 0 || numComps > 4) {
++ error(getPos(), "Bad number of components in DCT stream", prec);
++ return gFalse;
++ }
++ if (prec != 8) {
+ error(getPos(), "Bad DCT precision %d", prec);
+ return gFalse;
+ }
+@@ -2929,6 +2952,10 @@ GBool DCTStream::readProgressiveSOF() {
+ height = read16();
+ width = read16();
+ numComps = str->getChar();
++ if (numComps <= 0 || numComps > 4) {
++ error(getPos(), "Bad number of components in DCT stream");
++ return gFalse;
++ }
+ if (prec != 8) {
+ error(getPos(), "Bad DCT precision %d", prec);
+ return gFalse;
+@@ -2951,6 +2978,10 @@ GBool DCTStream::readScanInfo() {
+
+ length = read16() - 2;
+ scanInfo.numComps = str->getChar();
++ if (scanInfo.numComps <= 0 || scanInfo.numComps > 4) {
++ error(getPos(), "Bad number of components in DCT stream");
++ return gFalse;
++ }
+ --length;
+ if (length != 2 * scanInfo.numComps + 3) {
+ error(getPos(), "Bad DCT scan info block");
+@@ -3833,6 +3864,10 @@ FlateStream::FlateStream(Stream *strA, i
+ FilterStream(strA) {
+ if (predictor != 1) {
+ pred = new StreamPredictor(this, predictor, columns, colors, bits);
++ if (!pred->isOk()) {
++ delete pred;
++ pred = NULL;
++ }
+ } else {
+ pred = NULL;
+ }
+Index: kpdf/xpdf/xpdf/Stream.h
+===================================================================
+--- kpdf/xpdf/xpdf/Stream.h (revision 473213)
++++ kpdf/xpdf/xpdf/Stream.h (revision 487206)
+@@ -232,6 +232,8 @@ public:
+
+ ~StreamPredictor();
+
++ GBool isOk() { return ok; }
++
+ int lookChar();
+ int getChar();
+
+@@ -249,6 +251,7 @@ private:
+ int rowBytes; // bytes per line
+ Guchar *predLine; // line buffer
+ int predIdx; // current index in predLine
++ GBool ok;
+ };
+
+ //------------------------------------------------------------------------
+Index: kpdf/xpdf/xpdf/JPXStream.cc
+===================================================================
+--- kpdf/xpdf/xpdf/JPXStream.cc (revision 473213)
++++ kpdf/xpdf/xpdf/JPXStream.cc (revision 487206)
+@@ -7,6 +7,7 @@
+ //========================================================================
+
+ #include <aconf.h>
++#include <limits.h>
+
+ #ifdef USE_GCC_PRAGMAS
+ #pragma implementation
+@@ -783,7 +784,7 @@ GBool JPXStream::readCodestream(Guint /*
+ int segType;
+ GBool haveSIZ, haveCOD, haveQCD, haveSOT;
+ Guint precinctSize, style;
+- Guint segLen, capabilities, comp, i, j, r;
++ Guint segLen, capabilities, nTiles, comp, i, j, r;
+
+ //----- main header
+ haveSIZ = haveCOD = haveQCD = haveSOT = gFalse;
+@@ -818,8 +819,13 @@ GBool JPXStream::readCodestream(Guint /*
+ / img.xTileSize;
+ img.nYTiles = (img.ySize - img.yTileOffset + img.yTileSize - 1)
+ / img.yTileSize;
+- img.tiles = (JPXTile *)gmallocn(img.nXTiles * img.nYTiles,
+- sizeof(JPXTile));
++ nTiles = img.nXTiles * img.nYTiles;
++ // check for overflow before allocating memory
++ if (img.nXTiles <= 0 || img.nYTiles <= 0 || img.nXTiles >= INT_MAX / img.nYTiles) {
++ error(getPos(), "Bad tile count in JPX SIZ marker segment");
++ return gFalse;
++ }
++ img.tiles = (JPXTile *)gmallocn(nTiles, sizeof(JPXTile));
+ for (i = 0; i < img.nXTiles * img.nYTiles; ++i) {
+ img.tiles[i].tileComps = (JPXTileComp *)gmallocn(img.nComps,
+ sizeof(JPXTileComp));
diff --git a/kde-base/kpdf/kpdf-3.4.1-r2.ebuild b/kde-base/kpdf/kpdf-3.4.1-r3.ebuild
index a0d18b718a38..4714a8bb935c 100644
--- a/kde-base/kpdf/kpdf-3.4.1-r2.ebuild
+++ b/kde-base/kpdf/kpdf-3.4.1-r3.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/kde-base/kpdf/kpdf-3.4.1-r2.ebuild,v 1.1 2005/12/08 02:24:09 carlo Exp $
+# $Header: /var/cvsroot/gentoo-x86/kde-base/kpdf/kpdf-3.4.1-r3.ebuild,v 1.1 2005/12/09 20:58:52 carlo Exp $
KMNAME=kdegraphics
MAXKDEVER=$PV
@@ -14,7 +14,7 @@ KMEXTRA="kfile-plugins/pdf"
DEPEND=">=media-libs/freetype-2.0.5 media-libs/t1lib"
-PATCHES="${FILESDIR}/post-3.4.1-kdegraphics-4.diff ${FILESDIR}/kpdf-3.4.3-CAN-2005-3193.patch"
+PATCHES="${FILESDIR}/post-3.4.1-kdegraphics-4.diff ${FILESDIR}/post-3.4.3-kdegraphics-CAN-2005-3193.diff"
src_compile() {
myconf="${myconf} $(use_enable !nodrm kpdf-drm)"
diff --git a/kde-base/kpdf/kpdf-3.4.3-r1.ebuild b/kde-base/kpdf/kpdf-3.4.3-r2.ebuild
index d872dcc74256..2b09642dbcd2 100644
--- a/kde-base/kpdf/kpdf-3.4.3-r1.ebuild
+++ b/kde-base/kpdf/kpdf-3.4.3-r2.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/kde-base/kpdf/kpdf-3.4.3-r1.ebuild,v 1.4 2005/12/07 19:46:08 cryos Exp $
+# $Header: /var/cvsroot/gentoo-x86/kde-base/kpdf/kpdf-3.4.3-r2.ebuild,v 1.1 2005/12/09 20:58:52 carlo Exp $
KMNAME=kdegraphics
MAXKDEVER=$PV
@@ -8,13 +8,13 @@ KM_DEPRANGE="$PV $MAXKDEVER"
inherit kde-meta
DESCRIPTION="kpdf, a kde pdf viewer based on xpdf"
-KEYWORDS="~alpha amd64 ppc ppc64 ~sparc ~x86"
+KEYWORDS="~alpha ~amd64 ~ppc ~ppc64 ~sparc ~x86"
IUSE="nodrm"
KMEXTRA="kfile-plugins/pdf"
DEPEND=">=media-libs/freetype-2.0.5 media-libs/t1lib"
-PATCHES="${FILESDIR}/kpdf-3.4.3-CAN-2005-3193.patch"
+PATCHES="${FILESDIR}/post-3.4.3-kdegraphics-CAN-2005-3193.diff"
src_compile() {
myconf="${myconf} $(use_enable !nodrm kpdf-drm)"
diff --git a/kde-base/kpdf/kpdf-3.5.0-r1.ebuild b/kde-base/kpdf/kpdf-3.5.0-r2.ebuild
index 7e42a3b48ce8..a1f69defbd8a 100644
--- a/kde-base/kpdf/kpdf-3.5.0-r1.ebuild
+++ b/kde-base/kpdf/kpdf-3.5.0-r2.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/kde-base/kpdf/kpdf-3.5.0-r1.ebuild,v 1.1 2005/12/06 01:39:03 carlo Exp $
+# $Header: /var/cvsroot/gentoo-x86/kde-base/kpdf/kpdf-3.5.0-r2.ebuild,v 1.1 2005/12/09 20:58:52 carlo Exp $
KMNAME=kdegraphics
MAXKDEVER=$PV
@@ -16,7 +16,7 @@ DEPEND=">=media-libs/freetype-2.0.5
media-libs/t1lib
>=app-text/poppler-0.3.1"
-PATCHES="${FILESDIR}/kpdf-3.5.0-CAN-2005-3193.patch ${FILESDIR}/kpdf-3.5.0-splitter-io.patch"
+PATCHES="${FILESDIR}/post-3.5.0-kdegraphics-CAN-2005-3193.diff ${FILESDIR}/kpdf-3.5.0-splitter-io.patch"
pkg_setup() {
if ! built_with_use app-text/poppler qt; then