Add patch to fix bug #155949.
authorDiego Elio Pettenò <flameeyes@gentoo.org>
Tue, 5 Dec 2006 14:54:00 +0000 (14:54 +0000)
committerDiego Elio Pettenò <flameeyes@gentoo.org>
Tue, 5 Dec 2006 14:54:00 +0000 (14:54 +0000)
Package-Manager: portage-2.1.2_rc2-r5

kde-base/kdegraphics-kfile-plugins/ChangeLog
kde-base/kdegraphics-kfile-plugins/files/digest-kdegraphics-kfile-plugins-3.5.5-r1 [new file with mode: 0644]
kde-base/kdegraphics-kfile-plugins/files/post-3.5.5-kdegraphics.diff [new file with mode: 0644]
kde-base/kdegraphics-kfile-plugins/kdegraphics-kfile-plugins-3.5.5-r1.ebuild [new file with mode: 0644]
kde-base/kdegraphics/ChangeLog
kde-base/kdegraphics/files/digest-kdegraphics-3.5.5-r1 [new file with mode: 0644]
kde-base/kdegraphics/files/post-3.5.5-kdegraphics.diff [new file with mode: 0644]
kde-base/kdegraphics/kdegraphics-3.5.5-r1.ebuild [new file with mode: 0644]

index 6f66a50da1bb03e78a5a284c1016665f7c366d76..8fb87c2dada718af40a6d92f9fd8b5188c693690 100644 (file)
@@ -1,6 +1,13 @@
 # ChangeLog for kde-base/kdegraphics-kfile-plugins
 # Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/kde-base/kdegraphics-kfile-plugins/ChangeLog,v 1.61 2006/11/26 23:46:59 corsair Exp $
+# $Header: /var/cvsroot/gentoo-x86/kde-base/kdegraphics-kfile-plugins/ChangeLog,v 1.62 2006/12/05 14:54:00 flameeyes Exp $
+
+*kdegraphics-kfile-plugins-3.5.5-r1 (05 Dec 2006)
+
+  05 Dec 2006; Diego Pettenò <flameeyes@gentoo.org>
+  +files/post-3.5.5-kdegraphics.diff,
+  +kdegraphics-kfile-plugins-3.5.5-r1.ebuild:
+  Add patch to fix bug #155949.
 
   26 Nov 2006; Markus Rothe <corsair@gentoo.org>
   kdegraphics-kfile-plugins-3.5.5.ebuild:
diff --git a/kde-base/kdegraphics-kfile-plugins/files/digest-kdegraphics-kfile-plugins-3.5.5-r1 b/kde-base/kdegraphics-kfile-plugins/files/digest-kdegraphics-kfile-plugins-3.5.5-r1
new file mode 100644 (file)
index 0000000..7dbb38b
--- /dev/null
@@ -0,0 +1,3 @@
+MD5 cdbe15afc01c5da7af9557e803bbb7e6 kdegraphics-3.5.5.tar.bz2 7334117
+RMD160 c6febdf8ebd67110be3f27ada4c00e148403217f kdegraphics-3.5.5.tar.bz2 7334117
+SHA256 b6706d37568686e1ca4b4bb2cf1f79c027b94a512f6fe1156b7c7b7f79336f16 kdegraphics-3.5.5.tar.bz2 7334117
diff --git a/kde-base/kdegraphics-kfile-plugins/files/post-3.5.5-kdegraphics.diff b/kde-base/kdegraphics-kfile-plugins/files/post-3.5.5-kdegraphics.diff
new file mode 100644 (file)
index 0000000..881b817
--- /dev/null
@@ -0,0 +1,134 @@
+--- kfile-plugins/jpeg/exif.h
++++ kfile-plugins/jpeg/exif.h
+@@ -72,7 +72,8 @@
+     int Get32s(void * Long);
+     unsigned Get32u(void * Long);
+     double ConvertAnyFormat(void * ValuePtr, int Format);
+-    void ProcessExifDir(unsigned char * DirStart, unsigned char * OffsetBase, unsigned ExifLength);
++    void ProcessExifDir(unsigned char * DirStart, unsigned char * OffsetBase, unsigned ExifLength,
++            unsigned NestingLevel);
+     void process_COM (const uchar * Data, int length);
+     void process_SOFn (const uchar * Data, int marker);
+     int Get16m(const void * Short);
+--- kfile-plugins/jpeg/exif.cpp
++++ kfile-plugins/jpeg/exif.cpp
+@@ -446,7 +446,7 @@
+ //--------------------------------------------------------------------------
+ // Process one of the nested EXIF directories.
+ //--------------------------------------------------------------------------
+-void ExifData::ProcessExifDir(unsigned char * DirStart, unsigned char * OffsetBase, unsigned ExifLength)
++void ExifData::ProcessExifDir(unsigned char * DirStart, unsigned char * OffsetBase, unsigned ExifLength, unsigned NestingLevel)
+ {
+     int de;
+     int a;
+@@ -454,6 +454,9 @@
+     unsigned ThumbnailOffset = 0;
+     unsigned ThumbnailSize = 0;
++    if ( NestingLevel > 4)
++        throw FatalError("Maximum directory nesting exceeded (corrupt exif header)");
++
+     NumDirEntries = Get16u(DirStart);
+     #define DIR_ENTRY_ADDR(Start, Entry) (Start+2+12*(Entry))
+@@ -476,7 +479,7 @@
+     for (de=0;de<NumDirEntries;de++){
+         int Tag, Format, Components;
+         unsigned char * ValuePtr;
+-        int ByteCount;
++        unsigned ByteCount;
+         char * DirEntry;
+         DirEntry = (char *)DIR_ENTRY_ADDR(DirStart, de);
+@@ -489,6 +492,11 @@
+             throw FatalError("Illegal format code in EXIF dir");
+         }
++        if ((unsigned)Components > 0x10000) {
++            throw FatalError("Illegal number of components for tag");
++            continue;
++        }
++
+         ByteCount = Components * BytesPerFormat[Format];
+         if (ByteCount > 4){
+@@ -517,11 +525,11 @@
+         switch(Tag){
+             case TAG_MAKE:
+-                ExifData::CameraMake = QString((char*)ValuePtr);
++                ExifData::CameraMake = QString::fromLatin1((const char*)ValuePtr, 31);
+                 break;
+             case TAG_MODEL:
+-                ExifData::CameraModel = QString((char*)ValuePtr);
++                ExifData::CameraModel = QString::fromLatin1((const char*)ValuePtr, 39);
+               break;
+             case TAG_ORIENTATION:
+@@ -529,7 +537,7 @@
+                 break;
+             case TAG_DATETIME_ORIGINAL:
+-              DateTime = QString((char*)ValuePtr);
++              DateTime = QString::fromLatin1((const char*)ValuePtr, 19);
+                 break;
+             case TAG_USERCOMMENT:
+@@ -550,14 +558,12 @@
+                         int c;
+                         c = (ValuePtr)[a];
+                         if (c != '\0' && c != ' '){
+-                            //strncpy(ImageInfo.Comments, (const char*)(a+ValuePtr), 199);
+-                            UserComment.sprintf("%s", (const char*)(a+ValuePtr));
++                            UserComment = QString::fromLatin1((const char*)(a+ValuePtr), 199);
+                             break;
+                         }
+                     }
+                 }else{
+-                    //strncpy(ImageInfo.Comments, (const char*)ValuePtr, 199);
+-                    UserComment.sprintf("%s", (const char*)ValuePtr);
++                    UserComment = QString::fromLatin1((const char*)ValuePtr, 199);
+                 }
+                 break;
+@@ -676,10 +682,10 @@
+         if (Tag == TAG_EXIF_OFFSET || Tag == TAG_INTEROP_OFFSET){
+             unsigned char * SubdirStart;
+             SubdirStart = OffsetBase + Get32u(ValuePtr);
+-            if (SubdirStart < OffsetBase || SubdirStart > OffsetBase+ExifLength){
++            if (SubdirStart <= OffsetBase || SubdirStart >= OffsetBase+ExifLength){
+                 throw FatalError("Illegal subdirectory link");
+             }
+-            ProcessExifDir(SubdirStart, OffsetBase, ExifLength);
++            ProcessExifDir(SubdirStart, OffsetBase, ExifLength, NestingLevel+1);
+             continue;
+         }
+     }
+@@ -709,7 +715,7 @@
+                     }
+                 }else{
+                     if (SubdirStart <= OffsetBase+ExifLength){
+-                        ProcessExifDir(SubdirStart, OffsetBase, ExifLength);
++                        ProcessExifDir(SubdirStart, OffsetBase, ExifLength, NestingLevel+1);
+                     }
+                 }
+             }
+@@ -719,7 +725,7 @@
+     }
+     if (ThumbnailSize && ThumbnailOffset){
+-        if (ThumbnailSize + ThumbnailOffset <= ExifLength){
++        if (ThumbnailSize + ThumbnailOffset < ExifLength){
+             // The thumbnail pointer appears to be valid.  Store it.
+           Thumbnail.loadFromData(OffsetBase + ThumbnailOffset, ThumbnailSize, "JPEG");
+         }
+@@ -810,7 +816,7 @@
+     LastExifRefd = CharBuf;
+     // First directory starts 16 bytes in.  Offsets start at 8 bytes in.
+-    ProcessExifDir(CharBuf+16, CharBuf+8, length-6);
++    ProcessExifDir(CharBuf+16, CharBuf+8, length-6, 0);
+     // This is how far the interesting (non thumbnail) part of the exif went.
+     ExifSettingsLength = LastExifRefd - CharBuf;
diff --git a/kde-base/kdegraphics-kfile-plugins/kdegraphics-kfile-plugins-3.5.5-r1.ebuild b/kde-base/kdegraphics-kfile-plugins/kdegraphics-kfile-plugins-3.5.5-r1.ebuild
new file mode 100644 (file)
index 0000000..f8f94d5
--- /dev/null
@@ -0,0 +1,28 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/kde-base/kdegraphics-kfile-plugins/kdegraphics-kfile-plugins-3.5.5-r1.ebuild,v 1.1 2006/12/05 14:54:00 flameeyes Exp $
+
+KMNAME=kdegraphics
+KMMODULE=kfile-plugins
+MAXKDEVER=$PV
+KM_DEPRANGE="$PV $MAXKDEVER"
+inherit kde-meta eutils
+
+DESCRIPTION="kfile plugins from kdegraphics"
+KEYWORDS="~alpha ~amd64 ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd"
+IUSE="openexr"
+DEPEND="media-libs/tiff
+       openexr? ( media-libs/openexr )"
+
+# compilation of the tiff plugin depends on the check in acinclude.m4.in,
+# which doesn't have a switch.
+
+# ps installed with kghostview, pdf installed with kpdf
+KMEXTRACTONLY="kfile-plugins/ps kfile-plugins/pdf"
+
+PATCHES="${FILESDIR}/post-3.5.5-kdegraphics.diff"
+
+src_compile() {
+       myconf="$myconf $(use_with openexr)"
+       kde-meta_src_compile
+}
index d361655f572d649e857e0fc42befc03fdb52224b..635ebaa2bfc296605df90e72c3b9695bc6d37d57 100644 (file)
@@ -1,6 +1,12 @@
 # ChangeLog for kde-base/kdegraphics
 # Copyright 2002-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/kde-base/kdegraphics/ChangeLog,v 1.275 2006/12/03 19:31:40 corsair Exp $
+# $Header: /var/cvsroot/gentoo-x86/kde-base/kdegraphics/ChangeLog,v 1.276 2006/12/05 14:51:51 flameeyes Exp $
+
+*kdegraphics-3.5.5-r1 (05 Dec 2006)
+
+  05 Dec 2006; Diego Pettenò <flameeyes@gentoo.org>
+  +files/post-3.5.5-kdegraphics.diff, +kdegraphics-3.5.5-r1.ebuild:
+  Add patch to fix bug #155949.
 
   03 Dec 2006; Markus Rothe <corsair@gentoo.org> kdegraphics-3.5.5.ebuild:
   Stable on ppc64
diff --git a/kde-base/kdegraphics/files/digest-kdegraphics-3.5.5-r1 b/kde-base/kdegraphics/files/digest-kdegraphics-3.5.5-r1
new file mode 100644 (file)
index 0000000..0298d4d
--- /dev/null
@@ -0,0 +1,6 @@
+MD5 cdbe15afc01c5da7af9557e803bbb7e6 kdegraphics-3.5.5.tar.bz2 7334117
+RMD160 c6febdf8ebd67110be3f27ada4c00e148403217f kdegraphics-3.5.5.tar.bz2 7334117
+SHA256 b6706d37568686e1ca4b4bb2cf1f79c027b94a512f6fe1156b7c7b7f79336f16 kdegraphics-3.5.5.tar.bz2 7334117
+MD5 6bffd8365786b79b10db269588a8a281 kpdf-3.5.3-poppler-bis.patch.bz2 6283
+RMD160 b4d4bffd22a67cfdb86cf9c4614d31e56ed01757 kpdf-3.5.3-poppler-bis.patch.bz2 6283
+SHA256 08ea2cda6088ec33da22f0fbb2046de08bc6e26167b8373bbc22f891ed021a02 kpdf-3.5.3-poppler-bis.patch.bz2 6283
diff --git a/kde-base/kdegraphics/files/post-3.5.5-kdegraphics.diff b/kde-base/kdegraphics/files/post-3.5.5-kdegraphics.diff
new file mode 100644 (file)
index 0000000..881b817
--- /dev/null
@@ -0,0 +1,134 @@
+--- kfile-plugins/jpeg/exif.h
++++ kfile-plugins/jpeg/exif.h
+@@ -72,7 +72,8 @@
+     int Get32s(void * Long);
+     unsigned Get32u(void * Long);
+     double ConvertAnyFormat(void * ValuePtr, int Format);
+-    void ProcessExifDir(unsigned char * DirStart, unsigned char * OffsetBase, unsigned ExifLength);
++    void ProcessExifDir(unsigned char * DirStart, unsigned char * OffsetBase, unsigned ExifLength,
++            unsigned NestingLevel);
+     void process_COM (const uchar * Data, int length);
+     void process_SOFn (const uchar * Data, int marker);
+     int Get16m(const void * Short);
+--- kfile-plugins/jpeg/exif.cpp
++++ kfile-plugins/jpeg/exif.cpp
+@@ -446,7 +446,7 @@
+ //--------------------------------------------------------------------------
+ // Process one of the nested EXIF directories.
+ //--------------------------------------------------------------------------
+-void ExifData::ProcessExifDir(unsigned char * DirStart, unsigned char * OffsetBase, unsigned ExifLength)
++void ExifData::ProcessExifDir(unsigned char * DirStart, unsigned char * OffsetBase, unsigned ExifLength, unsigned NestingLevel)
+ {
+     int de;
+     int a;
+@@ -454,6 +454,9 @@
+     unsigned ThumbnailOffset = 0;
+     unsigned ThumbnailSize = 0;
++    if ( NestingLevel > 4)
++        throw FatalError("Maximum directory nesting exceeded (corrupt exif header)");
++
+     NumDirEntries = Get16u(DirStart);
+     #define DIR_ENTRY_ADDR(Start, Entry) (Start+2+12*(Entry))
+@@ -476,7 +479,7 @@
+     for (de=0;de<NumDirEntries;de++){
+         int Tag, Format, Components;
+         unsigned char * ValuePtr;
+-        int ByteCount;
++        unsigned ByteCount;
+         char * DirEntry;
+         DirEntry = (char *)DIR_ENTRY_ADDR(DirStart, de);
+@@ -489,6 +492,11 @@
+             throw FatalError("Illegal format code in EXIF dir");
+         }
++        if ((unsigned)Components > 0x10000) {
++            throw FatalError("Illegal number of components for tag");
++            continue;
++        }
++
+         ByteCount = Components * BytesPerFormat[Format];
+         if (ByteCount > 4){
+@@ -517,11 +525,11 @@
+         switch(Tag){
+             case TAG_MAKE:
+-                ExifData::CameraMake = QString((char*)ValuePtr);
++                ExifData::CameraMake = QString::fromLatin1((const char*)ValuePtr, 31);
+                 break;
+             case TAG_MODEL:
+-                ExifData::CameraModel = QString((char*)ValuePtr);
++                ExifData::CameraModel = QString::fromLatin1((const char*)ValuePtr, 39);
+               break;
+             case TAG_ORIENTATION:
+@@ -529,7 +537,7 @@
+                 break;
+             case TAG_DATETIME_ORIGINAL:
+-              DateTime = QString((char*)ValuePtr);
++              DateTime = QString::fromLatin1((const char*)ValuePtr, 19);
+                 break;
+             case TAG_USERCOMMENT:
+@@ -550,14 +558,12 @@
+                         int c;
+                         c = (ValuePtr)[a];
+                         if (c != '\0' && c != ' '){
+-                            //strncpy(ImageInfo.Comments, (const char*)(a+ValuePtr), 199);
+-                            UserComment.sprintf("%s", (const char*)(a+ValuePtr));
++                            UserComment = QString::fromLatin1((const char*)(a+ValuePtr), 199);
+                             break;
+                         }
+                     }
+                 }else{
+-                    //strncpy(ImageInfo.Comments, (const char*)ValuePtr, 199);
+-                    UserComment.sprintf("%s", (const char*)ValuePtr);
++                    UserComment = QString::fromLatin1((const char*)ValuePtr, 199);
+                 }
+                 break;
+@@ -676,10 +682,10 @@
+         if (Tag == TAG_EXIF_OFFSET || Tag == TAG_INTEROP_OFFSET){
+             unsigned char * SubdirStart;
+             SubdirStart = OffsetBase + Get32u(ValuePtr);
+-            if (SubdirStart < OffsetBase || SubdirStart > OffsetBase+ExifLength){
++            if (SubdirStart <= OffsetBase || SubdirStart >= OffsetBase+ExifLength){
+                 throw FatalError("Illegal subdirectory link");
+             }
+-            ProcessExifDir(SubdirStart, OffsetBase, ExifLength);
++            ProcessExifDir(SubdirStart, OffsetBase, ExifLength, NestingLevel+1);
+             continue;
+         }
+     }
+@@ -709,7 +715,7 @@
+                     }
+                 }else{
+                     if (SubdirStart <= OffsetBase+ExifLength){
+-                        ProcessExifDir(SubdirStart, OffsetBase, ExifLength);
++                        ProcessExifDir(SubdirStart, OffsetBase, ExifLength, NestingLevel+1);
+                     }
+                 }
+             }
+@@ -719,7 +725,7 @@
+     }
+     if (ThumbnailSize && ThumbnailOffset){
+-        if (ThumbnailSize + ThumbnailOffset <= ExifLength){
++        if (ThumbnailSize + ThumbnailOffset < ExifLength){
+             // The thumbnail pointer appears to be valid.  Store it.
+           Thumbnail.loadFromData(OffsetBase + ThumbnailOffset, ThumbnailSize, "JPEG");
+         }
+@@ -810,7 +816,7 @@
+     LastExifRefd = CharBuf;
+     // First directory starts 16 bytes in.  Offsets start at 8 bytes in.
+-    ProcessExifDir(CharBuf+16, CharBuf+8, length-6);
++    ProcessExifDir(CharBuf+16, CharBuf+8, length-6, 0);
+     // This is how far the interesting (non thumbnail) part of the exif went.
+     ExifSettingsLength = LastExifRefd - CharBuf;
diff --git a/kde-base/kdegraphics/kdegraphics-3.5.5-r1.ebuild b/kde-base/kdegraphics/kdegraphics-3.5.5-r1.ebuild
new file mode 100644 (file)
index 0000000..bcb8e52
--- /dev/null
@@ -0,0 +1,72 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/kde-base/kdegraphics/kdegraphics-3.5.5-r1.ebuild,v 1.1 2006/12/05 14:51:51 flameeyes Exp $
+
+inherit kde-dist eutils
+
+DESCRIPTION="KDE graphics-related apps"
+
+KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+IUSE="gphoto2 imlib openexr opengl pdf povray scanner tetex"
+
+DEPEND="~kde-base/kdebase-${PV}
+       >=media-libs/freetype-2
+       media-libs/fontconfig
+       gphoto2? ( media-libs/libgphoto2 )
+       scanner? ( media-gfx/sane-backends )
+       media-libs/libart_lgpl
+       media-libs/lcms
+       dev-libs/fribidi
+       imlib? ( media-libs/imlib )
+       virtual/ghostscript
+       media-libs/tiff
+       openexr? ( >=media-libs/openexr-1.2 )
+       povray? ( media-gfx/povray
+                 virtual/opengl )
+       pdf? ( >=app-text/poppler-0.5.1
+               >=app-text/poppler-bindings-0.5.1 )"
+
+RDEPEND="${DEPEND}
+       tetex? (
+       || ( >=app-text/tetex-2
+                app-text/ptex
+                app-text/cstetex
+                app-text/dvipdfm ) )"
+
+DEPEND="${DEPEND}
+       dev-util/pkgconfig"
+
+SRC_URI="${SRC_URI}
+       mirror://gentoo/kpdf-3.5.3-poppler-bis.patch.bz2"
+
+PATCHES="${DISTDIR}/kpdf-3.5.3-poppler-bis.patch.bz2
+       ${FILESDIR}/post-3.5.5-kdegraphics.diff"
+
+pkg_setup() {
+       kde_pkg_setup
+       for ghostscript in app-text/ghostscript-{gnu,esp,afpl}; do
+               if has_version ${ghostscript} && ! built_with_use ${ghostscript} X; then
+                       eerror "This package requires ${ghostscript} compiled with X11 support."
+                       eerror "Please reemerge ${ghostscript} with USE=\"X\"."
+                       die "Please reemerge ${ghostscript} with USE=\"X\"."
+               fi
+       done
+       if use pdf && ! built_with_use app-text/poppler-bindings qt3; then
+               eerror "This package requires app-text/poppler-bindings compiled with Qt 3.x support."
+               eerror "Please reemerge app-text/poppler-bindings with USE=\"qt3\"."
+               die "Please reemerge app-text/poppler-bindings with USE=\"qt3\"."
+       fi
+}
+
+src_compile() {
+       local myconf="$(use_with openexr) $(use_with pdf poppler)
+                                 $(use_with gphoto2 kamera)"
+
+       use imlib || export DO_NOT_COMPILE="${DO_NOT_COMPILE} kuickshow"
+       use scanner || export DO_NOT_COMPILE="${DO_NOT_COMPILE} kooka libkscan"
+       use povray || export DO_NOT_COMPILE="${DO_NOT_COMPILE} kpovmodeler"
+       use pdf || export DO_NOT_COMPILE="${DO_NOT_COMPILE} kpdf"
+
+       rm -f ${S}/configure # ask rebuilding
+       kde_src_compile
+}