[poppler] poppler/poppler: JPXStream.cc,1.5,1.6 Stream.cc,1.8,1.9

Kristian Høgsberg krh at freedesktop.org
Wed Dec 21 14:09:49 PST 2005


Update of /cvs/poppler/poppler/poppler
In directory gabe:/tmp/cvs-serv29004/poppler

Modified Files:
	JPXStream.cc Stream.cc 
Log Message:
2005-12-21  Kristian Høgsberg  <krh at redhat.com>

        * NEWS: Sum up 0.5 changes so far.

        * acinclude.m4: Split jpeg macros out into this file.

        * poppler/Stream.cc: Apply latest CVE-2005-3191 updates.



Index: JPXStream.cc
===================================================================
RCS file: /cvs/poppler/poppler/poppler/JPXStream.cc,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- JPXStream.cc	4 Dec 2005 18:53:40 -0000	1.5
+++ JPXStream.cc	21 Dec 2005 22:09:47 -0000	1.6
@@ -7,6 +7,7 @@
 //========================================================================
 
 #include <config.h>
+#include <limits.h>
 
 #ifdef USE_GCC_PRAGMAS
 #pragma implementation

Index: Stream.cc
===================================================================
RCS file: /cvs/poppler/poppler/poppler/Stream.cc,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- Stream.cc	9 Dec 2005 20:49:59 -0000	1.8
+++ Stream.cc	21 Dec 2005 22:09:47 -0000	1.9
@@ -15,6 +15,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <stddef.h>
+#include <limits.h>
 #ifndef WIN32
 #include <unistd.h>
 #endif
@@ -1283,7 +1284,7 @@
   endOfLine = endOfLineA;
   byteAlign = byteAlignA;
   columns = columnsA;
-  if (columns < 1) {
+  if (columns + 3 < 1 || columns + 4 < 1 || columns < 1) {
     columns = 1;
   }
   rows = rowsA;
@@ -2980,6 +2981,10 @@
 
   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");
@@ -3064,12 +3069,12 @@
   while (length > 0) {
     index = str->getChar();
     --length;
-    if ((index & 0x0f) >= 4) {
+    if ((index & ~0x10) >= 4 || (index & ~0x10) < 0) {
       error(getPos(), "Bad DCT Huffman table");
       return gFalse;
     }
     if (index & 0x10) {
-      index &= 0x0f;
+      index &= 0x03;
       if (index >= numACHuffTables)
 	numACHuffTables = index+1;
       tbl = &acHuffTables[index];



More information about the poppler mailing list