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

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


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

The following commit has been merged in the master branch:
commit 80a22118c9ae97ace1d7b3ca7cb338f0c15a9648
Author: Andreas Huggel <ahuggel at gmx.net>
Date:   Sun Aug 31 14:42:31 2008 +0000

    Added check for empty value before accessing toLong(0). (Bug reported by Gilles)
---
 src/tiffcomposite.cpp | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/src/tiffcomposite.cpp b/src/tiffcomposite.cpp
index e4605ed..82e9199 100644
--- a/src/tiffcomposite.cpp
+++ b/src/tiffcomposite.cpp
@@ -259,6 +259,27 @@ namespace Exiv2 {
         assert(pSize);
         assert(pValue());
 
+        if (pValue()->count() == 0) {
+#ifndef SUPPRESS_WARNINGS
+            std::cerr << "Warning: "
+                      << "Directory " << tiffGroupName(group())
+                      << ", entry 0x" << std::setw(4)
+                      << std::setfill('0') << std::hex << tag()
+                      << ": Data offset entry value is empty, ignoring it.
";
+#endif
+            return;
+        }
+        if (pValue()->count() != pSize->count()) {
+#ifndef SUPPRESS_WARNINGS
+            std::cerr << "Warning: "
+                      << "Directory " << tiffGroupName(group())
+                      << ", entry 0x" << std::setw(4)
+                      << std::setfill('0') << std::hex << tag()
+                      << ": Size and data offset entries have different"
+                      << " number of components, ignoring them.
";
+#endif
+            return;
+        }
         long size = 0;
         for (long i = 0; i < pSize->count(); ++i) {
             size += pSize->toLong(i);
@@ -873,7 +894,7 @@ namespace Exiv2 {
                                     uint32_t  dataIdx,
                                     uint32_t& /*imageIdx*/)
     {
-        if (!pValue()) return 0;
+        if (!pValue() || pValue()->count() == 0) return 0;
 
         DataBuf buf(pValue()->size());
         uint32_t idx = 0;

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list