diff options
author | Daniel Gryniewicz <dang@gentoo.org> | 2005-12-04 18:40:01 +0000 |
---|---|---|
committer | Daniel Gryniewicz <dang@gentoo.org> | 2005-12-04 18:40:01 +0000 |
commit | b03216506414cc5b19c3ca8dad6370c1843b616b (patch) | |
tree | 3ac32c099bf7f78bba19bed48e7db5ae787f98d9 /app-text/poppler/files | |
parent | Version bump (bug #113585) (diff) | |
download | gentoo-2-b03216506414cc5b19c3ca8dad6370c1843b616b.tar.gz gentoo-2-b03216506414cc5b19c3ca8dad6370c1843b616b.tar.bz2 gentoo-2-b03216506414cc5b19c3ca8dad6370c1843b616b.zip |
Fix for bug #114428
(Portage version: 2.0.53_rc7)
Diffstat (limited to 'app-text/poppler/files')
-rw-r--r-- | app-text/poppler/files/digest-poppler-0.4.2-r1 | 1 | ||||
-rw-r--r-- | app-text/poppler/files/poppler-0.4.2-CAN-2005-3193.patch | 123 |
2 files changed, 124 insertions, 0 deletions
diff --git a/app-text/poppler/files/digest-poppler-0.4.2-r1 b/app-text/poppler/files/digest-poppler-0.4.2-r1 new file mode 100644 index 000000000000..2c60c15e4850 --- /dev/null +++ b/app-text/poppler/files/digest-poppler-0.4.2-r1 @@ -0,0 +1 @@ +MD5 beb1eea135a3c5b679a7a22d01a500c0 poppler-0.4.2.tar.gz 777935 diff --git a/app-text/poppler/files/poppler-0.4.2-CAN-2005-3193.patch b/app-text/poppler/files/poppler-0.4.2-CAN-2005-3193.patch new file mode 100644 index 000000000000..6775f081766f --- /dev/null +++ b/app-text/poppler/files/poppler-0.4.2-CAN-2005-3193.patch @@ -0,0 +1,123 @@ +diff --exclude-from=/home/dang/.diffrc -u -ruN poppler-0.4.2.orig/poppler/JPXStream.cc poppler-0.4.2/poppler/JPXStream.cc +--- poppler-0.4.2.orig/poppler/JPXStream.cc 2005-03-03 14:46:03.000000000 -0500 ++++ poppler-0.4.2/poppler/JPXStream.cc 2005-12-04 13:30:39.000000000 -0500 +@@ -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,8 +701,13 @@ + / 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; ++ // 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)); + for (i = 0; i < img.nXTiles * img.nYTiles; ++i) { + img.tiles[i].tileComps = (JPXTileComp *)gmalloc(img.nComps * + sizeof(JPXTileComp)); +diff --exclude-from=/home/dang/.diffrc -u -ruN poppler-0.4.2.orig/poppler/Stream.cc poppler-0.4.2/poppler/Stream.cc +--- poppler-0.4.2.orig/poppler/Stream.cc 2005-04-27 16:56:18.000000000 -0400 ++++ poppler-0.4.2/poppler/Stream.cc 2005-12-04 13:22:20.000000000 -0500 +@@ -415,18 +415,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() { +@@ -1020,6 +1035,10 @@ + FilterStream(strA) { + if (predictor != 1) { + pred = new StreamPredictor(this, predictor, columns, colors, bits); ++ if (!pred->isOk()) { ++ delete pred; ++ pred = NULL; ++ } + } else { + pred = NULL; + } +@@ -2907,6 +2926,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; +@@ -3268,6 +3295,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 --exclude-from=/home/dang/.diffrc -u -ruN poppler-0.4.2.orig/poppler/Stream.h poppler-0.4.2/poppler/Stream.h +--- poppler-0.4.2.orig/poppler/Stream.h 2005-04-27 16:56:18.000000000 -0400 ++++ poppler-0.4.2/poppler/Stream.h 2005-12-04 13:22:20.000000000 -0500 +@@ -231,6 +231,8 @@ + + ~StreamPredictor(); + ++ GBool isOk() { return ok; } ++ + int lookChar(); + int getChar(); + +@@ -248,6 +250,7 @@ + int rowBytes; // bytes per line + Guchar *predLine; // line buffer + int predIdx; // current index in predLine ++ GBool ok; + }; + + //------------------------------------------------------------------------ |