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

Maximiliano Curia maxy at moszumanska.debian.org
Thu Jul 13 17:37:39 UTC 2017


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

The following commit has been merged in the master branch:
commit f24ac893ba66c64b9bac3826569ef043290c1153
Author: Andreas Huggel <ahuggel at gmx.net>
Date:   Tue May 23 14:43:31 2006 +0000

    Fixed algorithm to find TTW block in MRW images
---
 src/mrwimage.cpp | 25 +++++++++++++++++++------
 1 file changed, 19 insertions(+), 6 deletions(-)

diff --git a/src/mrwimage.cpp b/src/mrwimage.cpp
index 547db56..8a1d0c6 100644
--- a/src/mrwimage.cpp
+++ b/src/mrwimage.cpp
@@ -126,17 +126,30 @@ namespace Exiv2 {
         }
         clearMetadata();
 
-        // Read the image into a memory buffer
-        uint32_t const len = 16;
+        // Find the TTW block and read it into a buffer
+        uint32_t const len = 8;
         byte tmp[len];
         io_->read(tmp, len);
-        if (io_->error() || io_->eof()) throw Error(14);
+        uint32_t pos = len;
+        uint32_t const end = getULong(tmp + 4, bigEndian);
 
-        io_->seek(getLong(tmp + 12, bigEndian), BasicIo::cur);
+        pos += len; 
+        if (pos > end) throw Error(14);
+        io_->read(tmp, len);
         if (io_->error() || io_->eof()) throw Error(14);
+
+        while (memcmp(tmp + 1, "TTW", 3) != 0) {
+            uint32_t const siz = getULong(tmp + 4, bigEndian);
+            pos += siz;
+            if (pos > end) throw Error(14);
+            io_->seek(siz, BasicIo::cur);
+            if (io_->error() || io_->eof()) throw Error(14);
         
-        io_->read(tmp, 8);
-        if (io_->error() || io_->eof()) throw Error(14);
+            pos += len;
+            if (pos > end) throw Error(14);
+            io_->read(tmp, len);
+            if (io_->error() || io_->eof()) throw Error(14);
+        }
 
         DataBuf buf(getULong(tmp + 4, bigEndian));
         io_->read(buf.pData_, buf.size_);

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list