summaryrefslogtreecommitdiff
path: root/print/xpdf/patches/patch-at
blob: 1b020dc6867c9be736d790fe31ffabc545587f2c (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
$NetBSD: patch-at,v 1.1 2005/12/18 20:05:32 dillo Exp $

--- xpdf/Stream.cc.orig	2005-12-15 22:53:25.000000000 -0500
+++ xpdf/Stream.cc
@@ -2919,11 +2919,7 @@ GBool DCTStream::readBaselineSOF() {
   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);
+    error(getPos(), "Bad number of components %d in DCT stream", numComps);
     return gFalse;
   }
   if (prec != 8) {
@@ -2952,6 +2948,10 @@ GBool DCTStream::readProgressiveSOF() {
   height = read16();
   width = read16();
   numComps = str->getChar();
+  if (numComps <= 0 || numComps > 4) {
+    error(getPos(), "Bad number of components %d in DCT stream", numComps);
+    return gFalse;
+  }
   if (prec != 8) {
     error(getPos(), "Bad DCT precision %d", prec);
     return gFalse;