aboutsummaryrefslogtreecommitdiff
path: root/print/cups-base
diff options
context:
space:
mode:
authorMarcus Alves Grando <mnag@FreeBSD.org>2005-12-07 16:00:41 +0000
committerMarcus Alves Grando <mnag@FreeBSD.org>2005-12-07 16:00:41 +0000
commit950b32ed2bd523b2625a2a30a5eb986676d68684 (patch)
treece7a890a2a581f06dd627b46d8850c93d502d364 /print/cups-base
parentd1bd8ed621a645f124d5e7d8f632cb73b88da6f3 (diff)
downloadports-950b32ed2bd523b2625a2a30a5eb986676d68684.tar.gz
ports-950b32ed2bd523b2625a2a30a5eb986676d68684.zip
Notes
Diffstat (limited to 'print/cups-base')
-rw-r--r--print/cups-base/Makefile2
-rw-r--r--print/cups-base/files/patch-SA1789793
2 files changed, 94 insertions, 1 deletions
diff --git a/print/cups-base/Makefile b/print/cups-base/Makefile
index d3851571b11e..911072d2ea15 100644
--- a/print/cups-base/Makefile
+++ b/print/cups-base/Makefile
@@ -9,7 +9,7 @@
PORTNAME= cups-base
PORTVERSION= ${CUPS_PORTVER}
-PORTREVISION= 6
+PORTREVISION= 7
PORTEPOCH= ${CUPS_PORTEPOCH}
CATEGORIES= print
MASTER_SITES= ${CUPS_MASTER_SITES}
diff --git a/print/cups-base/files/patch-SA17897 b/print/cups-base/files/patch-SA17897
new file mode 100644
index 000000000000..6a37dc750924
--- /dev/null
+++ b/print/cups-base/files/patch-SA17897
@@ -0,0 +1,93 @@
+--- pdftops/Stream.cxx.orig Mon May 17 16:37:57 2004
++++ pdftops/Stream.cxx Tue Dec 6 18:05:14 2005
+@@ -407,18 +407,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() {
+@@ -1012,6 +1027,10 @@
+ FilterStream(strA) {
+ if (predictor != 1) {
+ pred = new StreamPredictor(this, predictor, columns, colors, bits);
++ if (!pred->isOk()) {
++ delete pred;
++ pred = NULL;
++ }
+ } else {
+ pred = NULL;
+ }
+@@ -2897,6 +2916,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;
+@@ -3255,6 +3282,10 @@
+ FilterStream(strA) {
+ if (predictor != 1) {
+ pred = new StreamPredictor(this, predictor, columns, colors, bits);
++ if (!pred->isOk()) {
++ delete pred;
++ pred = NULL;
++ }
+ } else {
+ pred = NULL;
+ }
+--- pdftops/Stream.h.orig Mon May 17 16:37:57 2004
++++ pdftops/Stream.h Tue Dec 6 18:05:14 2005
+@@ -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;
+ };
+
+ //------------------------------------------------------------------------