summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@gentoo.org>2006-12-05 14:54:00 +0000
committerDiego Elio Pettenò <flameeyes@gentoo.org>2006-12-05 14:54:00 +0000
commit53a76e06f2b14f08b39434672bda77b00fd1be0b (patch)
tree33ee39c0b9eaee2fecc8e08c680678c971af0c68 /kde-base/kdegraphics-kfile-plugins/files
parentStable for HPPA. (diff)
downloadgentoo-2-53a76e06f2b14f08b39434672bda77b00fd1be0b.tar.gz
gentoo-2-53a76e06f2b14f08b39434672bda77b00fd1be0b.tar.bz2
gentoo-2-53a76e06f2b14f08b39434672bda77b00fd1be0b.zip
Add patch to fix bug #155949.
(Portage version: 2.1.2_rc2-r5)
Diffstat (limited to 'kde-base/kdegraphics-kfile-plugins/files')
-rw-r--r--kde-base/kdegraphics-kfile-plugins/files/digest-kdegraphics-kfile-plugins-3.5.5-r13
-rw-r--r--kde-base/kdegraphics-kfile-plugins/files/post-3.5.5-kdegraphics.diff134
2 files changed, 137 insertions, 0 deletions
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
index 000000000000..7dbb38b9a877
--- /dev/null
+++ b/kde-base/kdegraphics-kfile-plugins/files/digest-kdegraphics-kfile-plugins-3.5.5-r1
@@ -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
index 000000000000..881b81757ab4
--- /dev/null
+++ b/kde-base/kdegraphics-kfile-plugins/files/post-3.5.5-kdegraphics.diff
@@ -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;