diff options
author | Martin Ehmsen <ehmsen@gentoo.org> | 2006-05-28 21:56:38 +0000 |
---|---|---|
committer | Martin Ehmsen <ehmsen@gentoo.org> | 2006-05-28 21:56:38 +0000 |
commit | e1b441d905efc574421667d883add1d3d29397d5 (patch) | |
tree | b1bc7d775b38ea140e5333f884f9b237d2b0fd27 /app-text | |
parent | Initial import of texlive (diff) | |
download | gentoo-2-e1b441d905efc574421667d883add1d3d29397d5.tar.gz gentoo-2-e1b441d905efc574421667d883add1d3d29397d5.tar.bz2 gentoo-2-e1b441d905efc574421667d883add1d3d29397d5.zip |
Initial import of texlive
(Portage version: 2.1_rc2-r3)
(Signed Manifest commit)
Diffstat (limited to 'app-text')
9 files changed, 356 insertions, 8 deletions
diff --git a/app-text/texlive/Manifest b/app-text/texlive/Manifest index 7f064e6603ac..87c3a202850e 100644 --- a/app-text/texlive/Manifest +++ b/app-text/texlive/Manifest @@ -1,3 +1,6 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + AUX 2005/texlive-2005-amd64-xdvik-wp.patch 891 RMD160 b5ca77437fb3cb65ab28ded97a122009dda581dd SHA1 f6046af61e128b0b2967687e679109224032c192 SHA256 47644a39dbaafebbb580f421fb6993744a9a74626fee474adfe4cc4a22718749 MD5 196e2ac417459761152c317025da2141 files/2005/texlive-2005-amd64-xdvik-wp.patch 891 RMD160 b5ca77437fb3cb65ab28ded97a122009dda581dd files/2005/texlive-2005-amd64-xdvik-wp.patch 891 @@ -37,14 +40,14 @@ SHA256 eca7bdd52d000a0d8405641f83773f37e528da3300ed1bfaf010252e264a2fe5 files/te DIST texlive-2005-src.tar.bz2 18754502 RMD160 ac2c390cad8160028b2754c46a347847d6523346 SHA1 a4078d825c38874c6aa4c3dc070c203c66e913d2 SHA256 faf645ca74889c35ec9df5902e8b0d7afe1eb29477574a6747810b671afef674 DIST texlive-2005-texmf-dist.tar.bz2 408486129 RMD160 32d046f1363028bf8164bd1525a60968ca78ec39 SHA1 fba766bff12fb04e7859c1b39c8a10ccaadbfcad SHA256 ef6838f569cdbcc7ce49b1102be7797995c1b0e82e0c9b593acf0c5b133b843c DIST texlive-2005-texmf.tar.bz2 16285465 RMD160 bcdad713732a49607005130b8f707f7fbeb59815 SHA1 c7c87c55bd5cccbde62b07d8180b2816c6d169ce SHA256 ffe9d2ec59a30aa4972ae21a99e8e0ea85648204a77f9e114b01bd3a8a603a6b -EBUILD texlive-2005.ebuild 7234 RMD160 358fafcc10768856ca45eedbe69cf39080278733 SHA1 d9c9c7bb701b07953e989764180c0485d456a228 SHA256 03570a475772e1fd2f53227c00ea44ccd4e9e25d881b300efd48edf09b169830 -MD5 6a69043668d9224540cb43b4eb928f11 texlive-2005.ebuild 7234 -RMD160 358fafcc10768856ca45eedbe69cf39080278733 texlive-2005.ebuild 7234 -SHA256 03570a475772e1fd2f53227c00ea44ccd4e9e25d881b300efd48edf09b169830 texlive-2005.ebuild 7234 -MISC ChangeLog 704 RMD160 7aaf66a0a5b708782dae590d4689f534c9099678 SHA1 aebc152d78b8ecce794314170b23c9b11eedf887 SHA256 fafa577f74fda08359cb83cb541ddd241ac1ff7b66b8fb53a485535925014a7d -MD5 432ca38618503b4ce724731fa969fcb3 ChangeLog 704 -RMD160 7aaf66a0a5b708782dae590d4689f534c9099678 ChangeLog 704 -SHA256 fafa577f74fda08359cb83cb541ddd241ac1ff7b66b8fb53a485535925014a7d ChangeLog 704 +EBUILD texlive-2005.ebuild 7332 RMD160 e3606c8d0d4bd279c8d0c560735887a39d025a8e SHA1 0cf805ca1250d7371c5cbda13aa7ed0b86d47a98 SHA256 f92e21cefbd05048069cb0e6299e580a9401bfa23f0dd87c79d9567161f3b94d +MD5 e188e7a13fdd2b4b404c17130b981f83 texlive-2005.ebuild 7332 +RMD160 e3606c8d0d4bd279c8d0c560735887a39d025a8e texlive-2005.ebuild 7332 +SHA256 f92e21cefbd05048069cb0e6299e580a9401bfa23f0dd87c79d9567161f3b94d texlive-2005.ebuild 7332 +MISC ChangeLog 792 RMD160 009ee3e46d05c815aa54e602658130436e24d6c2 SHA1 fc5acefe125d9cf1bcbd2f27ab609ee29d4b84d0 SHA256 c4dac136eb2d723de384a4e602f3c094b3a13a448db6bb0fd1851b8a8440b27e +MD5 c28a5e3c2114f24f637366ffa26ce7b0 ChangeLog 792 +RMD160 009ee3e46d05c815aa54e602658130436e24d6c2 ChangeLog 792 +SHA256 c4dac136eb2d723de384a4e602f3c094b3a13a448db6bb0fd1851b8a8440b27e ChangeLog 792 MISC metadata.xml 164 RMD160 698422e821458386b8da17baa6014296f8284e0b SHA1 a805613d38e6e3bff93cba3858d6a92cc79fe2f7 SHA256 7bd4d93c657a26aa9af1dea4232520c0d388cc92115dd9ca0eb04259228e044f MD5 c472f5fd1646eb8bca71d8df5cb2bdcc metadata.xml 164 RMD160 698422e821458386b8da17baa6014296f8284e0b metadata.xml 164 @@ -52,3 +55,10 @@ SHA256 7bd4d93c657a26aa9af1dea4232520c0d388cc92115dd9ca0eb04259228e044f metadata MD5 9c7fbe19385a877bcd96ce75c347ad09 files/digest-texlive-2005 807 RMD160 b3467176f93577677e4fded094c285a53b0be5e0 files/digest-texlive-2005 807 SHA256 391f065bfc3c3cc88cbd4690c772c1550e16696ba934362f5523ea9b5a234607 files/digest-texlive-2005 807 +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.3 (GNU/Linux) + +iD8DBQFEehyRzxUa4FWw6mwRAlSoAJ0RZYkeyzxHIdCjBQ8/d6tyf8JpcACeMYwl +kwc8PEz6vYIRF0Z2T+kwbfA= +=UBn6 +-----END PGP SIGNATURE----- diff --git a/app-text/texlive/files/2005/texlive-2005-amd64-xdvik-wp.patch b/app-text/texlive/files/2005/texlive-2005-amd64-xdvik-wp.patch new file mode 100644 index 000000000000..7358b1803ab1 --- /dev/null +++ b/app-text/texlive/files/2005/texlive-2005-amd64-xdvik-wp.patch @@ -0,0 +1,27 @@ +diff -urN TeX.orig/texk/xdvik/x_util.c TeX/texk/xdvik/x_util.c +--- TeX.orig/texk/xdvik/x_util.c 2004-12-03 00:40:41.000000000 +0100 ++++ TeX/texk/xdvik/x_util.c 2006-05-27 23:09:34.000000000 +0200 +@@ -205,15 +205,15 @@ + w = (*((xuint32 *) window_p)); + #else + # if WORDS_BIGENDIAN +- w = ((unsigned long)wp[0] << 24) | +- ((unsigned long)wp[1] << 16) | +- ((unsigned long)wp[2] << 8) | +- (unsigned long)wp[3]; ++ w = ((unsigned long)window_p[0] << 24) | ++ ((unsigned long)window_p[1] << 16) | ++ ((unsigned long)window_p[2] << 8) | ++ (unsigned long)window_p[3]; + # else +- w = ((unsigned long)wp[3] << 24) | +- ((unsigned long)wp[2] << 16) | +- ((unsigned long)wp[1] << 8) | +- (unsigned long)wp[0]; ++ w = ((unsigned long)window_p[3] << 24) | ++ ((unsigned long)window_p[2] << 16) | ++ ((unsigned long)window_p[1] << 8) | ++ (unsigned long)window_p[0]; + # endif + #endif + return w; diff --git a/app-text/texlive/files/2005/texlive-2005-create-empty-files.patch b/app-text/texlive/files/2005/texlive-2005-create-empty-files.patch new file mode 100644 index 000000000000..e021a2dfc12e --- /dev/null +++ b/app-text/texlive/files/2005/texlive-2005-create-empty-files.patch @@ -0,0 +1,24 @@ +diff -urN TeX.orig/texk/kpathsea/mktexlsr TeX/texk/kpathsea/mktexlsr +--- TeX.orig/texk/kpathsea/mktexlsr 2005-06-21 16:32:26.000000000 +0200 ++++ TeX/texk/kpathsea/mktexlsr 2006-05-27 23:46:52.000000000 +0200 +@@ -108,7 +108,7 @@ + test -w "$db_dir" || { echo "$progname: $db_dir: directory not writable. Skipping..." >&2; continue; } + + if test ! -f "$db_file"; then +- cp /dev/null "$db_file" ++ touch "$db_file" + # Use same permissions as parent directory, minus x,s, or t bits. + chmod `kpsestat -xst "$db_dir"` "$db_file" + elif test -s "$db_file" \ +diff -urN TeX.orig/texk/make/man.mk TeX/texk/make/man.mk +--- TeX.orig/texk/make/man.mk 2002-11-12 21:54:15.000000000 +0100 ++++ TeX/texk/make/man.mk 2006-05-27 23:46:52.000000000 +0200 +@@ -28,7 +28,7 @@ + # Makefile can change for reasons that do not affect the man pages. + # At present, all but VERSION should be unused. + sedscript: +- cp /dev/null sedscript ++ touch sedscript + for f in $(kpathsea_dir)/paths.h; do \ + sed -n -e '/^#define/s/#define[ ][ ]*\([A-Z_a-z][A-Z_a-z]*\)[ ][ ]*\(.*\)/s%@\1@%\2%/p' \ + $$f \ diff --git a/app-text/texlive/files/2005/texlive-2005-fmtutil-in.patch b/app-text/texlive/files/2005/texlive-2005-fmtutil-in.patch new file mode 100644 index 000000000000..578ac34290a1 --- /dev/null +++ b/app-text/texlive/files/2005/texlive-2005-fmtutil-in.patch @@ -0,0 +1,38 @@ +diff -urN TeX.orig/texk/web2c/fmtutil.in TeX/texk/web2c/fmtutil.in +--- TeX.orig/texk/web2c/fmtutil.in 2005-09-12 18:09:28.000000000 +0200 ++++ TeX/texk/web2c/fmtutil.in 2006-05-27 23:39:05.000000000 +0200 +@@ -45,9 +45,10 @@ + # if you want babel support in tex. Add -translate-file=cp227.tcx before tex.ini + # if you want to make all characters directly "printable" for + # any \write (instead of ^^xy). +-tex tex - tex.ini ++tex tex language.dat tex.ini + latex pdfetex language.dat -translate-file=cp227.tcx *latex.ini + etex pdfetex language.def -translate-file=cp227.tcx *etex.ini ++elatex pdfetex language.def -translate-file=cp227.tcx *latex.ini + pdftex pdfetex - -translate-file=cp227.tcx *pdftex.ini + pdflatex pdfetex language.dat -translate-file=cp227.tcx *pdflatex.ini + pdfetex pdfetex language.def -translate-file=cp227.tcx *pdfetex.ini +@@ -60,11 +61,11 @@ + + # Change "amstex.ini -> bamstex.ini" and "- -> language.dat" + # if you want babel support in amstex: +-amstex pdfetex - -translate-file=cp227.tcx *amstex.ini ++amstex pdfetex language.dat -translate-file=cp227.tcx *amstex.ini + + # Change "pdfamstex.ini -> pdfbamstex.ini" and "- -> language.dat" + # if you want babel support in pdfamstex: +-#! pdfamstex pdfetex - -translate-file=cp227.tcx *pdfamstex.ini ++pdfamstex pdfetex language.dat -translate-file=cp227.tcx *pdfamstex.ini + + # Context formats: + #! cont-cz pdfetex cont-usr.tex -8bit *cont-cz.ini +@@ -116,7 +117,7 @@ + + # Change "eplain.ini -> ebplain.ini" and "- -> language.dat" + # if you want babel support in eplain: +-eplain pdfetex - -translate-file=cp227.tcx *eplain.ini ++eplain pdfetex language.dat -translate-file=cp227.tcx *eplain.ini + + # mptopdf utility + mptopdf pdfetex - -translate-file=cp227.tcx mptopdf.tex diff --git a/app-text/texlive/files/2005/texlive-2005-gentoo-texmf-site.patch b/app-text/texlive/files/2005/texlive-2005-gentoo-texmf-site.patch new file mode 100644 index 000000000000..3ed13325ecb6 --- /dev/null +++ b/app-text/texlive/files/2005/texlive-2005-gentoo-texmf-site.patch @@ -0,0 +1,26 @@ +diff -urN TeX.orig/texk/kpathsea/texmf.in TeX/texk/kpathsea/texmf.in +--- TeX.orig/texk/kpathsea/texmf.in 2005-08-31 21:42:48.000000000 +0200 ++++ TeX/texk/kpathsea/texmf.in 2006-05-27 23:56:46.000000000 +0200 +@@ -61,6 +61,9 @@ + % The main distribution tree: + TEXMFDIST = @texmf@-dist + ++% The Gentoo site tree: ++TEXMFSITE = /usr/share/texmf-site ++ + % A place for local additions to a "standard" texmf tree. + % This tree is not used for local configuration maintained by + % texconfig, it uses TEXMFCONFIG below. +@@ -111,10 +114,10 @@ + % + % For texconfig to work properly, TEXMFCONFIG and TEXMFVAR should be named + % explicitly and before all other trees. +-TEXMF = {!!$TEXMFCONFIG,!!$TEXMFVAR,$TEXMFHOME,!!$TEXMFSYSCONFIG,!!$TEXMFSYSVAR,!!$TEXMFMAIN,!!$TEXMFLOCAL,!!$TEXMFDIST} ++TEXMF = {!!$TEXMFCONFIG,!!$TEXMFVAR,$TEXMFHOME,!!$TEXMFSYSCONFIG,!!$TEXMFSYSVAR,!!$TEXMFMAIN,!!$TEXMFLOCAL,!!$TEXMFSITE,!!$TEXMFDIST} + + % The system trees. These are the trees that are shared by all the users. +-SYSTEXMF = $TEXMFLOCAL;$TEXMFMAIN;$TEXMFDIST ++SYSTEXMF = $TEXMFLOCAL;$TEXMFMAIN;$TEXMFDIST;$TEXMFSITE + + % Where generated fonts may be written. This tree is used when the sources + % were found in a system tree and either that tree wasn't writable, or the diff --git a/app-text/texlive/files/2005/texlive-2005-mptest.patch b/app-text/texlive/files/2005/texlive-2005-mptest.patch new file mode 100644 index 000000000000..f99c8a5bba94 --- /dev/null +++ b/app-text/texlive/files/2005/texlive-2005-mptest.patch @@ -0,0 +1,11 @@ +diff -urN TeX.orig/texk/web2c/tests/mptest.mp TeX/texk/web2c/tests/mptest.mp +--- TeX.orig/texk/web2c/tests/mptest.mp 2000-06-21 00:27:56.000000000 +0200 ++++ TeX/texk/web2c/tests/mptest.mp 2006-05-27 23:12:52.000000000 +0200 +@@ -40,6 +40,6 @@ + + message("* Test for big numbers in btex...etex:"); + picture q; +-q = btex $2^{12} = 4096 \qquad 2^{15} = 32768$ etex; ++%q = btex $2^{12} = 4096 \qquad 2^{15} = 32768$ etex; + + end. diff --git a/app-text/texlive/files/2005/texlive-2005-pdftosrc-install.patch b/app-text/texlive/files/2005/texlive-2005-pdftosrc-install.patch new file mode 100644 index 000000000000..960bba6d6908 --- /dev/null +++ b/app-text/texlive/files/2005/texlive-2005-pdftosrc-install.patch @@ -0,0 +1,19 @@ +diff -urN TeX.orig/texk/web2c/Makefile.in TeX/texk/web2c/Makefile.in +--- TeX.orig/texk/web2c/Makefile.in 2005-08-03 11:08:02.000000000 +0200 ++++ TeX/texk/web2c/Makefile.in 2006-05-27 23:45:48.000000000 +0200 +@@ -562,13 +562,13 @@ + # Common + programs = bibtex ctangle ctie cweave dvicopy dvitomp dvitype gftodvi gftopk \ + gftype mft $(odvicopy) $(odvitype) $(otangle) patgen pktogf pktype pltotf \ +- pooltype tangle tftopl tie $(ttf2afm) vftovp vptovf weave ++ pooltype tangle tftopl tie $(ttf2afm) vftovp vptovf weave pdftosrc + engines = $(tex) $(etex) $(mf) $(mfn) $(mpost) \ + $(omega) $(aleph) \ + $(pdftex) $(pdfetex) + + programs: $(programs) $(engines) $(mpware_programs) \ +- $(omegafonts_programs) $(otps_programs) $(pdftosrc) ++ $(omegafonts_programs) $(otps_programs) + + # Additional dependencies for relinking. + # Note that each program and engine already depends on $(web2c_programs). diff --git a/app-text/texlive/files/2005/texlive-2005-use-system-libtool.patch b/app-text/texlive/files/2005/texlive-2005-use-system-libtool.patch new file mode 100644 index 000000000000..3b8df13efd41 --- /dev/null +++ b/app-text/texlive/files/2005/texlive-2005-use-system-libtool.patch @@ -0,0 +1,50 @@ +diff -urN TeX.orig/texk/kpathsea/configure TeX/texk/kpathsea/configure +--- TeX.orig/texk/kpathsea/configure 2005-08-21 22:04:18.000000000 +0200 ++++ TeX/texk/kpathsea/configure 2006-05-27 20:01:29.000000000 +0200 +@@ -5539,7 +5539,11 @@ + LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" + + # Always use our own libtool. +-LIBTOOL='$(SHELL) $(top_builddir)/libtool' ++if [ "${USERLAND}" = "Darwin" ]; then ++LIBTOOL='glibtool' ++else ++LIBTOOL='libtool' ++fi + + # Prevent multiple expansion + +diff -urN TeX.orig/texk/libtool.m4 TeX/texk/libtool.m4 +--- TeX.orig/texk/libtool.m4 2005-08-14 16:13:04.000000000 +0200 ++++ TeX/texk/libtool.m4 2006-05-27 20:02:13.000000000 +0200 +@@ -31,7 +31,13 @@ + LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" + + # Always use our own libtool. +-LIBTOOL='$(SHELL) $(top_builddir)/libtool' ++# Use the system libtool ++if [ "${USERLAND}" = "Darwin" ]; then ++LIBTOOL='glibtool' ++else ++LIBTOOL='libtool' ++fi ++ + AC_SUBST(LIBTOOL)dnl + + # Prevent multiple expansion +diff -urN TeX.orig/texk/make/common.mk TeX/texk/make/common.mk +--- TeX.orig/texk/make/common.mk 2004-08-06 20:40:50.000000000 +0200 ++++ TeX/texk/make/common.mk 2006-05-27 20:03:18.000000000 +0200 +@@ -12,7 +12,11 @@ + LDFLAGS = @LDFLAGS@ $(XLDFLAGS) + + # Kpathsea needs this for compiling, programs need it for linking. +-LIBTOOL = $(SHELL) $(kpathsea_parent)/libtool ++ifeq ($(USERLAND),Darwin) ++LIBTOOL='glibtool' ++else ++LIBTOOL='libtool' ++endif + + # You can change [X]CPPFLAGS, [X]CFLAGS, or [X]DEFS, but + # please don't change ALL_CPPFLAGS or ALL_CFLAGS. diff --git a/app-text/texlive/files/2005/texlive-2005-xpdf-vulnerabilities.patch b/app-text/texlive/files/2005/texlive-2005-xpdf-vulnerabilities.patch new file mode 100644 index 000000000000..7ad201d4e2d2 --- /dev/null +++ b/app-text/texlive/files/2005/texlive-2005-xpdf-vulnerabilities.patch @@ -0,0 +1,143 @@ +diff -urN TeX.orig/libs/xpdf/xpdf/JBIG2Stream.cc TeX/libs/xpdf/xpdf/JBIG2Stream.cc +--- TeX.orig/libs/xpdf/xpdf/JBIG2Stream.cc 2005-08-17 07:34:31.000000000 +0200 ++++ TeX/libs/xpdf/xpdf/JBIG2Stream.cc 2006-05-28 23:52:10.000000000 +0200 +@@ -7,6 +7,7 @@ + //======================================================================== + + #include <aconf.h> ++#include <limits.h> + + #ifdef USE_GCC_PRAGMAS + #pragma implementation +@@ -681,6 +682,11 @@ + w = wA; + h = hA; + line = (wA + 7) >> 3; ++ if (h < 0 || line <= 0 || h >= (INT_MAX - 1) / line) { ++ error(-1, "invalid width/height"); ++ data = NULL; ++ return; ++ } + // need to allocate one extra guard byte for use in combine() + data = (Guchar *)gmalloc(h * line + 1); + data[h * line] = 0; +@@ -692,6 +698,11 @@ + w = bitmap->w; + h = bitmap->h; + line = bitmap->line; ++ if (h < 0 || line <= 0 || h >= (INT_MAX - 1) / line) { ++ error(-1, "invalid width/height"); ++ data = NULL; ++ return; ++ } + // need to allocate one extra guard byte for use in combine() + data = (Guchar *)gmalloc(h * line + 1); + memcpy(data, bitmap->data, h * line); +@@ -720,7 +731,10 @@ + } + + void JBIG2Bitmap::expand(int newH, Guint pixel) { +- if (newH <= h) { ++ if (newH <= h || line <= 0 || newH >= (INT_MAX - 1) / line) { ++ error(-1, "invalid width/height"); ++ gfree(data); ++ data = NULL; + return; + } + // need to allocate one extra guard byte for use in combine() +@@ -2936,6 +2950,11 @@ + JBIG2BitmapPtr tpgrCXPtr0, tpgrCXPtr1, tpgrCXPtr2; + int x, y, pix; + ++ if (w < 0 || h <= 0 || w >= INT_MAX / h) { ++ error(-1, "invalid width/height"); ++ return NULL; ++ } ++ + bitmap = new JBIG2Bitmap(0, w, h); + bitmap->clearToZero(); + +diff -urN TeX.orig/libs/xpdf/xpdf/JPXStream.cc TeX/libs/xpdf/xpdf/JPXStream.cc +--- TeX.orig/libs/xpdf/xpdf/JPXStream.cc 2005-08-17 07:34:31.000000000 +0200 ++++ TeX/libs/xpdf/xpdf/JPXStream.cc 2006-05-28 23:44:00.000000000 +0200 +@@ -7,6 +7,7 @@ + //======================================================================== + + #include <aconf.h> ++#include <limits.h> + + #ifdef USE_GCC_PRAGMAS + #pragma implementation +diff -urN TeX.orig/libs/xpdf/xpdf/Stream.cc TeX/libs/xpdf/xpdf/Stream.cc +--- TeX.orig/libs/xpdf/xpdf/Stream.cc 2005-08-17 07:34:31.000000000 +0200 ++++ TeX/libs/xpdf/xpdf/Stream.cc 2006-05-28 23:49:26.000000000 +0200 +@@ -7,6 +7,7 @@ + //======================================================================== + + #include <aconf.h> ++#include <limits.h> + + #ifdef USE_GCC_PRAGMAS + #pragma implementation +@@ -1256,8 +1257,9 @@ + endOfLine = endOfLineA; + byteAlign = byteAlignA; + columns = columnsA; +- if (columns < 1) { +- columns = 1; ++ if (columns < 1 || columns >= INT_MAX / sizeof(short)) { ++ error (-1, "invalid number of columns: %d\n", columns); ++ exit (1); + } + rows = rowsA; + endOfBlock = endOfBlockA; +@@ -2925,6 +2927,10 @@ + 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 (prec != 8) { + error(getPos(), "Bad DCT precision %d", prec); + return gFalse; +@@ -2947,6 +2953,11 @@ + + length = read16() - 2; + scanInfo.numComps = str->getChar(); ++ if (scanInfo.numComps <= 0 || scanInfo.numComps > 4) { ++ scanInfo.numComps = 0; ++ 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"); +@@ -3031,12 +3042,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]; +@@ -3154,9 +3165,11 @@ + do { + do { + c = str->getChar(); ++ if (c == EOF) return EOF; + } while (c != 0xff && c != EOF); + do { + c = str->getChar(); ++ if (c == EOF) return EOF; + } while (c == 0xff); + } while (c == 0x00); + return c; |