fixed: Incorrect length calculation for keywords from IPTC tags in which could result...
authorlookup69 <lookup69@gmail.com>
Wed, 20 Nov 2013 07:40:11 +0000 (15:40 +0800)
committerJonathan Marshall <jmarshall@xbmc.org>
Sat, 21 Dec 2013 04:56:09 +0000 (17:56 +1300)
lib/libexif/IptcParse.cpp

index 1fc7dfb..a0bba16 100644 (file)
@@ -201,8 +201,10 @@ bool CIptcParse::Process (const unsigned char* const Data, const unsigned short
         // there may be multiple keywords - lets join them
         size_t maxLen = MAX_IPTC_STRING - strlen(tag);
         if (maxLen > 2)
+        {
           strcat(tag, ", ");
-        strncat(tag, pos, min(length, MAX_IPTC_STRING - maxLen - 3));
+          strncat(tag, pos, min(length, maxLen - 3));
+        }
       }
 /*      if (id == SLIDE_IPTC_CAPTION)
       {