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

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


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

The following commit has been merged in the master branch:
commit f1db95c52f1cc9a3661c3fd012976d4d85f07aa7
Author: Andreas Huggel <ahuggel at gmx.net>
Date:   Tue Nov 17 14:34:35 2009 +0000

    #656: Replaced assertions with a proper test.
---
 src/makernote.cpp | 46 +++++++++-------------------------------------
 1 file changed, 9 insertions(+), 37 deletions(-)

diff --git a/src/makernote.cpp b/src/makernote.cpp
index 988dee3..f1faef4 100644
--- a/src/makernote.cpp
+++ b/src/makernote.cpp
@@ -286,10 +286,7 @@ namespace Exiv2 {
                                uint32_t size,
                                ByteOrder /*byteOrder*/)
     {
-        assert (pData != 0);
-
-        if (size < size_) return false;
-
+        if (!pData || size < size_) return false;
         header_.alloc(size_);
         std::memcpy(header_.pData_, pData, header_.size_);
         if (   static_cast<uint32_t>(header_.size_) < size_
@@ -320,10 +317,7 @@ namespace Exiv2 {
                                 uint32_t size,
                                 ByteOrder /*byteOrder*/)
     {
-        assert (pData != 0);
-
-        if (size < size_) return false;
-
+        if (!pData || size < size_) return false;
         header_.alloc(size_);
         std::memcpy(header_.pData_, pData, header_.size_);
         if (   static_cast<uint32_t>(header_.size_) < size_
@@ -355,17 +349,12 @@ namespace Exiv2 {
                             uint32_t size,
                             ByteOrder /*byteOrder*/)
     {
-        assert (pData != 0);
-
-        if (size < size_) return false;
-
+        if (!pData || size < size_) return false;
         header_.alloc(size_);
         std::memcpy(header_.pData_, pData, header_.size_);
-
         // Read offset to the IFD relative to the start of the makernote
         // from the header. Note that we ignore the byteOrder argument
         start_ = getULong(header_.pData_ + 8, byteOrder_);
-
         if (   static_cast<uint32_t>(header_.size_) < size_
             || 0 != memcmp(header_.pData_, signature_, 8)) {
             return false;
@@ -394,15 +383,12 @@ namespace Exiv2 {
                               uint32_t    size,
                               ByteOrder   /*byteOrder*/)
     {
-        assert (pData != 0);
-
-        if (size < size_) return false;
+        if (!pData || size < size_) return false;
         if (0 != memcmp(pData, signature_, 6)) return false;
         buf_.alloc(size_);
         std::memcpy(buf_.pData_, pData, buf_.size_);
         start_ = size_;
         return true;
-
     } // Nikon2MnHeader::read
 
     uint32_t Nikon2MnHeader::write(Blob&     blob,
@@ -430,9 +416,7 @@ namespace Exiv2 {
                               uint32_t    size,
                               ByteOrder   /*byteOrder*/)
     {
-        assert (pData != 0);
-
-        if (size < size_) return false;
+        if (!pData || size < size_) return false;
         if (0 != memcmp(pData, signature_, 6)) return false;
         buf_.alloc(size_);
         std::memcpy(buf_.pData_, pData, buf_.size_);
@@ -441,7 +425,6 @@ namespace Exiv2 {
         byteOrder_ = th.byteOrder();
         start_ = 10 + th.offset();
         return true;
-
     } // Nikon3MnHeader::read
 
     uint32_t Nikon3MnHeader::write(Blob&     blob,
@@ -475,15 +458,12 @@ namespace Exiv2 {
                                  uint32_t    size,
                                  ByteOrder   /*byteOrder*/)
     {
-        assert (pData != 0);
-
-        if (size < size_) return false;
+        if (!pData || size < size_) return false;
         if (0 != memcmp(pData, signature_, 9)) return false;
         buf_.alloc(size_);
         std::memcpy(buf_.pData_, pData, buf_.size_);
         start_ = size_;
         return true;
-
     } // PanasonicMnHeader::read
 
     uint32_t PanasonicMnHeader::write(Blob&     blob,
@@ -507,9 +487,7 @@ namespace Exiv2 {
                               uint32_t size,
                               ByteOrder /*byteOrder*/)
     {
-        assert (pData != 0);
-
-        if (size < size_) return false;
+        if (!pData || size < size_) return false;
         header_.alloc(size_);
         std::memcpy(header_.pData_, pData, header_.size_);
         if (   static_cast<uint32_t>(header_.size_) < size_
@@ -543,16 +521,13 @@ namespace Exiv2 {
                              uint32_t    size,
                              ByteOrder   /*byteOrder*/)
     {
-        assert (pData != 0);
-
-        if (size < size_) return false;
+        if (!pData || size < size_) return false;
         if (   0 != memcmp(pData, signature1_, 8)
             && 0 != memcmp(pData, signature2_, 8)) return false;
         buf_.alloc(size_);
         std::memcpy(buf_.pData_, pData, buf_.size_);
         start_ = size_;
         return true;
-
     } // SigmaMnHeader::read
 
     uint32_t SigmaMnHeader::write(Blob&     blob,
@@ -576,15 +551,12 @@ namespace Exiv2 {
                             uint32_t    size,
                             ByteOrder   /*byteOrder*/)
     {
-        assert (pData != 0);
-
-        if (size < size_) return false;
+        if (!pData || size < size_) return false;
         if (0 != memcmp(pData, signature_, size_)) return false;
         buf_.alloc(size_);
         std::memcpy(buf_.pData_, pData, buf_.size_);
         start_ = size_;
         return true;
-
     } // SonyMnHeader::read
 
     uint32_t SonyMnHeader::write(Blob&     blob,

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list