[SCM] exiv2 packaging branch, master, updated. debian/0.25-3.1-3734-gdcbc29a

Maximiliano Curia maxy at moszumanska.debian.org
Thu Jul 13 17:45:49 UTC 2017


Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=98eeab8

The following commit has been merged in the master branch:
commit 98eeab85dae6701ccf2d31bb67bc19f0510ef102
Author: Robin Mills <robin at clanmills.com>
Date:   Sun Oct 11 00:10:47 2015 +0000

    #1089.  Thank You to Felix for reporting this and providing a patch.
---
 src/tags.cpp | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/src/tags.cpp b/src/tags.cpp
index fcedb5d..b1a475a 100644
--- a/src/tags.cpp
+++ b/src/tags.cpp
@@ -1474,8 +1474,8 @@ namespace Exiv2 {
 
     //! FileSource, tag 0xa300
     extern const TagDetails exifFileSource[] = {
-        { 1, N_("Film scanner")            },	// Not defined to Exif 2.2 spec.
-        { 2, N_("Reflexion print scanner") },	// but used by some scanner device softwares.
+        { 1, N_("Film scanner")            },   // Not defined to Exif 2.2 spec.
+        { 2, N_("Reflexion print scanner") },   // but used by some scanner device softwares.
         { 3, N_("Digital still camera")    }
     };
 
@@ -2320,8 +2320,18 @@ namespace Exiv2 {
         if (value.typeId() == unsignedByte && value.size() > 0) {
             DataBuf buf(value.size());
             value.copy(buf.pData_, invalidByteOrder);
-            // Strip trailing UCS-2 0-character, if there is one
-            if (buf.pData_[buf.size_ - 1] == 0 && buf.pData_[buf.size_ - 2] == 0)  buf.size_ -= 2;
+            // Strip trailing odd byte due to failing UCS-2 conversion
+            if (buf.size_ % 2 == 1)  buf.size_ -=1;
+
+            // Strip trailing UCS-2 0-characters
+            while (buf.size_ >= 2) {
+                if (buf.pData_[buf.size_ - 1] == 0 && buf.pData_[buf.size_ - 2] == 0) {
+                    buf.size_ -= 2;
+                } else {
+                    break;
+                }
+            }
+
             std::string str((const char*)buf.pData_, buf.size_);
             cnv = convertStringCharset(str, "UCS-2LE", "UTF-8");
             if (cnv) os << str;
@@ -2866,7 +2876,7 @@ namespace Exiv2 {
 
     const char* ExifTags::ifdName(const std::string& groupName)
     {
-        IfdId ifdId = Internal::groupId(groupName);        
+        IfdId ifdId = Internal::groupId(groupName);
         return Internal::ifdName(ifdId);
     }
 

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list