aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xlib/libexif/ExifParse.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libexif/ExifParse.cpp b/lib/libexif/ExifParse.cpp
index d651fb16d8..7e4482e933 100755
--- a/lib/libexif/ExifParse.cpp
+++ b/lib/libexif/ExifParse.cpp
@@ -485,8 +485,8 @@ void CExifParse::ProcessDir(const unsigned char* const DirStart,
{
// The XP user comment field is always unicode (UCS-2) encoded
m_ExifInfo->CommentsCharset = EXIF_COMMENT_CHARSET_UNICODE;
-
- memcpy(m_ExifInfo->Comments, ValuePtr, ByteCount);
+ size_t length = min(ByteCount, MAX_COMMENT);
+ memcpy(m_ExifInfo->Comments, ValuePtr, length);
}
break;