summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2005-12-21 22:09:47 +0000
committerKristian Høgsberg <krh@redhat.com>2005-12-21 22:09:47 +0000
commit8d9cf43aaa73d5012428a6a4c5d7e2cccbd3036e (patch)
treeddf390ec44b8d16ad9979b3b800ccf641716b97c
parent97243286560cb4f264b875185c8768a6af09d554 (diff)
2005-12-21 Kristian Høgsberg <krh@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.
-rw-r--r--ChangeLog8
-rw-r--r--NEWS8
-rw-r--r--acinclude.m4112
-rw-r--r--configure.ac114
-rw-r--r--poppler/JPXStream.cc1
-rw-r--r--poppler/Stream.cc11
6 files changed, 137 insertions, 117 deletions
diff --git a/ChangeLog b/ChangeLog
index fe1e6bde..aeb1d9ec 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2005-12-21 Kristian Høgsberg <krh@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.
+
+2005-12-21 Kristian Høgsberg <krh@redhat.com>
+
* utils/Makefile.am: Add parseargs.h to sources and add
-I$(top_srcdir)/poppler to INCLUDES.
diff --git a/NEWS b/NEWS
index 6bef497f..7132586f 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,11 @@
+Release 0.5.0
+
+ - Font matching code for non embedded fonts now use fontconfig
+ instead of hard coded list of fonts.
+ - Merge in Xpdf 3.01 changes.
+ - Add command line tools from Xpdf.
+ - Make install of Xpdf header files ./configure'able.
+
Release 0.4.0
- Real text selection.
diff --git a/acinclude.m4 b/acinclude.m4
new file mode 100644
index 00000000..4f63a065
--- /dev/null
+++ b/acinclude.m4
@@ -0,0 +1,112 @@
+dnl Based on Xpdf configure.in and evince configure.ac
+
+dnl Based on kde acinclude.m4.in, LGPL Licensed
+
+AC_DEFUN([AC_FIND_FILE],
+[
+$3=NO
+for i in $2;
+do
+ for j in $1;
+ do
+ echo "configure: __oline__: $i/$j" >&AC_FD_CC
+ if test -r "$i/$j"; then
+ echo "taking that" >&AC_FD_CC
+ $3=$i
+ break 2
+ fi
+ done
+done
+])
+
+AC_DEFUN([KDE_FIND_JPEG_HELPER],
+[
+AC_MSG_CHECKING([for libjpeg$2])
+AC_CACHE_VAL(ac_cv_lib_jpeg_$1,
+[
+ac_save_LIBS="$LIBS"
+LIBS="$all_libraries $USER_LDFLAGS -ljpeg$2 -lm"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
+AC_TRY_LINK(
+[
+#ifdef __cplusplus
+extern "C" {
+#endif
+void jpeg_CreateDecompress();
+#ifdef __cplusplus
+}
+#endif
+],
+[jpeg_CreateDecompress();],
+ eval "ac_cv_lib_jpeg_$1=-ljpeg$2",
+ eval "ac_cv_lib_jpeg_$1=no")
+LIBS="$ac_save_LIBS"
+CFLAGS="$ac_save_CFLAGS"
+])
+
+if eval "test ! \"`echo $ac_cv_lib_jpeg_$1`\" = no"; then
+ enable_libjpeg=yes
+ LIBJPEG_LIBS="$ac_cv_lib_jpeg_$1"
+ AC_MSG_RESULT($ac_cv_lib_jpeg_$1)
+else
+ AC_MSG_RESULT(no)
+ $3
+fi
+
+])
+
+AC_DEFUN([AC_FIND_JPEG],
+[
+dnl first look for libraries
+KDE_FIND_JPEG_HELPER(6b, 6b,
+ KDE_FIND_JPEG_HELPER(normal, [],
+ [
+ LIBJPEG_LIBS=
+ ]
+ )
+)
+
+dnl then search the headers (can't use simply AC_TRY_xxx, as jpeglib.h
+dnl requires system dependent includes loaded before it)
+jpeg_incdirs="$includedir /usr/include /usr/local/include "
+AC_FIND_FILE(jpeglib.h, $jpeg_incdirs, jpeg_incdir)
+test "x$jpeg_incdir" = xNO && jpeg_incdir=
+
+dnl if headers _and_ libraries are missing, this is no error, and we
+dnl continue with a warning (the user will get no jpeg support)
+dnl if only one is missing, it means a configuration error, but we still
+dnl only warn
+if test -n "$jpeg_incdir" && test -n "$LIBJPEG_LIBS" ; then
+ AC_DEFINE_UNQUOTED(ENABLE_LIBJPEG, 1, [Define if you have libjpeg])
+else
+ if test -n "$jpeg_incdir" || test -n "$LIBJPEG_LIBS" ; then
+ AC_MSG_WARN([
+There is an installation error in jpeg support. You seem to have only one
+of either the headers _or_ the libraries installed. You may need to either
+provide correct --with-extra-... options, or the development package of
+libjpeg6b. You can get a source package of libjpeg from http://www.ijg.org/
+Disabling JPEG support.
+])
+ else
+ AC_MSG_WARN([libjpeg not found. disable JPEG support.])
+ fi
+ jpeg_incdir=
+ enable_libjpeg=no
+ LIBJPEG_LIBS=
+fi
+
+AC_SUBST(LIBJPEG_LIBS)
+AH_VERBATIM(_AC_CHECK_JPEG,
+[/*
+ * jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system
+ * headers and I'm too lazy to write a configure test as long as only
+ * unixware is related
+ */
+#ifdef _UNIXWARE
+#define HAVE_BOOLEAN
+#endif
+])
+])
+
+dnl Based on kde acinclude.m4.in, LGPL Licensed
diff --git a/configure.ac b/configure.ac
index c3403a41..7b76fe37 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,117 +1,3 @@
-dnl Based on Xpdf configure.in and evince configure.ac
-
-dnl Based on kde acinclude.m4.in, LGPL Licensed
-
-AC_DEFUN([AC_FIND_FILE],
-[
-$3=NO
-for i in $2;
-do
- for j in $1;
- do
- echo "configure: __oline__: $i/$j" >&AC_FD_CC
- if test -r "$i/$j"; then
- echo "taking that" >&AC_FD_CC
- $3=$i
- break 2
- fi
- done
-done
-])
-
-AC_DEFUN([KDE_FIND_JPEG_HELPER],
-[
-AC_MSG_CHECKING([for libjpeg$2])
-AC_CACHE_VAL(ac_cv_lib_jpeg_$1,
-[
-ac_save_LIBS="$LIBS"
-LIBS="$all_libraries $USER_LDFLAGS -ljpeg$2 -lm"
-ac_save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
-AC_TRY_LINK(
-[
-#ifdef __cplusplus
-extern "C" {
-#endif
-void jpeg_CreateDecompress();
-#ifdef __cplusplus
-}
-#endif
-],
-[jpeg_CreateDecompress();],
- eval "ac_cv_lib_jpeg_$1=-ljpeg$2",
- eval "ac_cv_lib_jpeg_$1=no")
-LIBS="$ac_save_LIBS"
-CFLAGS="$ac_save_CFLAGS"
-])
-
-if eval "test ! \"`echo $ac_cv_lib_jpeg_$1`\" = no"; then
- enable_libjpeg=yes
- LIBJPEG_LIBS="$ac_cv_lib_jpeg_$1"
- AC_MSG_RESULT($ac_cv_lib_jpeg_$1)
-else
- AC_MSG_RESULT(no)
- $3
-fi
-
-])
-
-AC_DEFUN([AC_FIND_JPEG],
-[
-dnl first look for libraries
-KDE_FIND_JPEG_HELPER(6b, 6b,
- KDE_FIND_JPEG_HELPER(normal, [],
- [
- LIBJPEG_LIBS=
- ]
- )
-)
-
-dnl then search the headers (can't use simply AC_TRY_xxx, as jpeglib.h
-dnl requires system dependent includes loaded before it)
-jpeg_incdirs="$includedir /usr/include /usr/local/include "
-AC_FIND_FILE(jpeglib.h, $jpeg_incdirs, jpeg_incdir)
-test "x$jpeg_incdir" = xNO && jpeg_incdir=
-
-dnl if headers _and_ libraries are missing, this is no error, and we
-dnl continue with a warning (the user will get no jpeg support)
-dnl if only one is missing, it means a configuration error, but we still
-dnl only warn
-if test -n "$jpeg_incdir" && test -n "$LIBJPEG_LIBS" ; then
- AC_DEFINE_UNQUOTED(ENABLE_LIBJPEG, 1, [Define if you have libjpeg])
-else
- if test -n "$jpeg_incdir" || test -n "$LIBJPEG_LIBS" ; then
- AC_MSG_WARN([
-There is an installation error in jpeg support. You seem to have only one
-of either the headers _or_ the libraries installed. You may need to either
-provide correct --with-extra-... options, or the development package of
-libjpeg6b. You can get a source package of libjpeg from http://www.ijg.org/
-Disabling JPEG support.
-])
- else
- AC_MSG_WARN([libjpeg not found. disable JPEG support.])
- fi
- jpeg_incdir=
- enable_libjpeg=no
- LIBJPEG_LIBS=
-fi
-
-AC_SUBST(LIBJPEG_LIBS)
-AH_VERBATIM(_AC_CHECK_JPEG,
-[/*
- * jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system
- * headers and I'm too lazy to write a configure test as long as only
- * unixware is related
- */
-#ifdef _UNIXWARE
-#define HAVE_BOOLEAN
-#endif
-])
-])
-
-dnl Based on kde acinclude.m4.in, LGPL Licensed
-
-
AC_PREREQ(2.59)
AC_INIT(poppler, 0.5.0)
AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
diff --git a/poppler/JPXStream.cc b/poppler/JPXStream.cc
index 4beeb24a..9b2823f6 100644
--- a/poppler/JPXStream.cc
+++ b/poppler/JPXStream.cc
@@ -7,6 +7,7 @@
//========================================================================
#include <config.h>
+#include <limits.h>
#ifdef USE_GCC_PRAGMAS
#pragma implementation
diff --git a/poppler/Stream.cc b/poppler/Stream.cc
index 954715d3..7f87bcc0 100644
--- a/poppler/Stream.cc
+++ b/poppler/Stream.cc
@@ -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 @@ CCITTFaxStream::CCITTFaxStream(Stream *strA, int encodingA, GBool endOfLineA,
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 @@ 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");
@@ -3064,12 +3069,12 @@ GBool DCTStream::readHuffmanTables() {
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];