diff options
-rw-r--r-- | lib/libexif/ExifParse.cpp | 4 | ||||
-rw-r--r-- | lib/libexif/IptcParse.cpp | 7 |
2 files changed, 4 insertions, 7 deletions
diff --git a/lib/libexif/ExifParse.cpp b/lib/libexif/ExifParse.cpp index a905e80c54..2386fd3dab 100644 --- a/lib/libexif/ExifParse.cpp +++ b/lib/libexif/ExifParse.cpp @@ -416,7 +416,7 @@ void CExifParse::ProcessDir(const unsigned char* const DirStart, case TAG_DESCRIPTION: { int length = max(ByteCount, 0); - length = min(length, 2000); + length = min(length, MAX_COMMENT); strncpy(m_ExifInfo->Description, (char *)ValuePtr, length); break; } @@ -452,7 +452,7 @@ void CExifParse::ProcessDir(const unsigned char* const DirStart, { const int EXIF_COMMENT_HDR_LENGTH = 8; // All comment tags have 8 bytes of header info int length = max(ByteCount - EXIF_COMMENT_HDR_LENGTH, 0); - length = min(length, 2000); + length = min(length, MAX_COMMENT); strncpy(m_ExifInfo->Comments, (char *)ValuePtr+EXIF_COMMENT_HDR_LENGTH, length); // FixComment(comment); // Ensure comment is printable } diff --git a/lib/libexif/IptcParse.cpp b/lib/libexif/IptcParse.cpp index 1ac94c0483..b58e1f0189 100644 --- a/lib/libexif/IptcParse.cpp +++ b/lib/libexif/IptcParse.cpp @@ -133,9 +133,6 @@ bool CIptcParse::Process (const unsigned char* const Data, const unsigned short if (pos + 4 >= maxpos) return false; - // Get length (Motorola format) - //unsigned long length = CExifParse::Get32(pos); - pos += 4; // move data pointer to the next field // Now read IPTC data @@ -145,13 +142,13 @@ bool CIptcParse::Process (const unsigned char* const Data, const unsigned short short signature = (*pos << 8) + (*(pos+1)); - pos += sizeof(short); + pos += 2; if (signature != 0x1C01 && signature != 0x1C02) break; unsigned char type = *pos++; unsigned short length = (*pos << 8) + (*(pos+1)); - pos += sizeof(short); // Skip tag length + pos += 2; // Skip tag length if (pos + length > maxpos) return false; |