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

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


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

The following commit has been merged in the master branch:
commit 64d1308ec726625bc03caf99486de0bec33f4f17
Author: Andreas Huggel <ahuggel at gmx.net>
Date:   Thu Jul 21 05:01:12 2011 +0000

    #769: Fixed calculation of binary array size in the case when the array elements are not sorted in ascending order, added test case.
---
 src/tiffcomposite.cpp       |  12 ++++++++++--
 test/bugfixes-test.sh       |   6 ++++++
 test/data/bugfixes-test.out | Bin 82214 -> 82852 bytes
 3 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/src/tiffcomposite.cpp b/src/tiffcomposite.cpp
index 9e9c269..d14e96e 100644
--- a/src/tiffcomposite.cpp
+++ b/src/tiffcomposite.cpp
@@ -1689,11 +1689,19 @@ namespace Exiv2 {
 
         if (elements_.empty()) return 0;
 
+        // Remaining assumptions:
+        // - array elements don't "overlap"
+        // - no duplicate tags in the array
         uint32_t idx = 0;
+        uint32_t sz = cfg()->tagStep();
         for (Components::const_iterator i = elements_.begin(); i != elements_.end(); ++i) {
-            idx = EXV_MAX(idx, (*i)->tag() * cfg()->tagStep());
-            idx += (*i)->size();
+            if ((*i)->tag() > idx) {
+                idx = (*i)->tag();
+                sz = (*i)->size();
+            }
         }
+        idx = idx * cfg()->tagStep() + sz;
+
         if (cfg()->hasFillers_ && def()) {
             const ArrayDef* lastDef = def() + defSize() - 1;
             uint16_t lastTag = static_cast<uint16_t>(lastDef->idx_ / cfg()->tagStep());
diff --git a/test/bugfixes-test.sh b/test/bugfixes-test.sh
index c6ec1c3..f92fc0a 100755
--- a/test/bugfixes-test.sh
+++ b/test/bugfixes-test.sh
@@ -186,6 +186,12 @@ cp -f ../data/exiv2-empty.jpg $filename
 $bin/exiv2 -u -v -M"set Exif.Image.Make Samsung" $filename
 $samples/easyaccess-test $filename
 
+num=769
+filename=exiv2-bug$num.jpg
+cp -f ../data/exiv2-empty.jpg $filename
+$bin/exiv2 -u -v -M"add Exif.Image.Make Canon" -M"add Exif.CanonCs.0x0001 Short 1" -M"add Exif.CanonCs.0x0000 Short 2" $filename
+$bin/exiv2 -u -v -PEkyct $filename
+
 ) > $results 2>&1
 
 # ----------------------------------------------------------------------
diff --git a/test/data/bugfixes-test.out b/test/data/bugfixes-test.out
index b218ddd..a2d840b 100644
Binary files a/test/data/bugfixes-test.out and b/test/data/bugfixes-test.out differ

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list