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

Maximiliano Curia maxy at moszumanska.debian.org
Thu Jul 13 17:41:07 UTC 2017


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

The following commit has been merged in the master branch:
commit d00c806e3ccc77934dc5f490412ca80ccc9d1858
Author: Andreas Huggel <ahuggel at gmx.net>
Date:   Tue Jan 19 13:50:20 2010 +0000

    #673: Accept XMP sidecars starting with a UTF-8 BOM.
---
 src/xmpsidecar.cpp | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/xmpsidecar.cpp b/src/xmpsidecar.cpp
index dac4a4e..b40f3df 100644
--- a/src/xmpsidecar.cpp
+++ b/src/xmpsidecar.cpp
@@ -168,21 +168,26 @@ namespace Exiv2 {
 
         // Todo: Proper implementation
 
-        const int32_t len = 10;
+        const int32_t len = 13;
         byte buf[len];
         iIo.read(buf, len);
         if (iIo.error() || iIo.eof()) {
             return false;
         }
+        // Skip leading BOM
+        int32_t start = 0;
+        if (0 == strncmp(reinterpret_cast<const char*>(buf), "\xef\xbb\xbf", 3)) {
+            start = 3;
+        }
         bool rc = false;
-        const std::string head(reinterpret_cast<const char*>(buf), len);
+        const std::string head(reinterpret_cast<const char*>(buf + start), len - start);
         if (   head.substr(0, 5)  == "<?xml"
             || head.substr(0, 9)  == "<?xpacket"
             || head.substr(0, 10) == "<x:xmpmeta") {
             rc = true;
         }
         if (!advance || !rc) {
-            iIo.seek(-len, BasicIo::cur);
+            iIo.seek(-(len - start), BasicIo::cur); // Swallow the BOM
         }
         return rc;
 

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list