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

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


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

The following commit has been merged in the master branch:
commit 41243f8653460e3f1077dffd62e15085e9f562d6
Author: Robin Mills <robin at clanmills.com>
Date:   Mon Mar 9 10:28:08 2015 +0000

    #1038.  Thank You to Vitaliy for reporting this and providing the patch.
---
 include/exiv2/quicktimevideo.hpp | 2 +-
 src/basicio.cpp                  | 5 ++---
 src/quicktimevideo.cpp           | 6 +++++-
 3 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/include/exiv2/quicktimevideo.hpp b/include/exiv2/quicktimevideo.hpp
index 9a8b1d4..3050aaf 100644
--- a/include/exiv2/quicktimevideo.hpp
+++ b/include/exiv2/quicktimevideo.hpp
@@ -223,7 +223,7 @@ namespace Exiv2 {
 
     private:
         //! Variable which stores Time Scale unit, used to calculate time.
-        uint64_t timeScale_;
+        uint64_t timeScale_ = 1;
         //! Variable which stores current stream being processsed.
         int currentStream_;
         //! Variable to check the end of metadata traversing.
diff --git a/src/basicio.cpp b/src/basicio.cpp
index 65c7500..2ae0e12 100644
--- a/src/basicio.cpp
+++ b/src/basicio.cpp
@@ -1257,7 +1257,6 @@ namespace Exiv2 {
         case BasicIo::end: newIdx = p_->size_ + offset; break;
         }
 
-        if ( /*newIdx < 0 || */ newIdx > static_cast<uint64_t>(p_->size_) ) return 1;
         p_->idx_ = static_cast<long>(newIdx);   //not very sure about this. need more test!!    - note by Shawn  fly2xj at gmail.com //TODO
         p_->eof_ = false;
         return 0;
@@ -1273,7 +1272,7 @@ namespace Exiv2 {
         case BasicIo::end: newIdx = p_->size_ + offset; break;
         }
 
-        if (newIdx < 0 || newIdx > p_->size_) return 1;
+        if (newIdx < 0) return 1;
         p_->idx_ = newIdx;
         p_->eof_ = false;
         return 0;
@@ -1327,7 +1326,7 @@ namespace Exiv2 {
 
     long MemIo::read(byte* buf, long rcount)
     {
-        long avail = p_->size_ - p_->idx_;
+        long avail = EXV_MAX(p_->size_ - p_->idx_, 0);
         long allow = EXV_MIN(rcount, avail);
         std::memcpy(buf, &p_->data_[p_->idx_], allow);
         p_->idx_ += allow;
diff --git a/src/quicktimevideo.cpp b/src/quicktimevideo.cpp
index 1bde4d7..e7ca8c2 100644
--- a/src/quicktimevideo.cpp
+++ b/src/quicktimevideo.cpp
@@ -1456,6 +1456,8 @@ namespace Exiv2 {
                 else if (currentStream_ == Audio)
                     xmpData_["Xmp.audio.MediaTimeScale"] = returnBufValue(buf);
                 time_scale = returnBufValue(buf);
+                if (time_scale <= 0)
+                    time_scale = 1;
                 break;
             case MediaDuration:
                 if(currentStream_ == Video)
@@ -1571,7 +1573,9 @@ namespace Exiv2 {
                 xmpData_["Xmp.video.ModificationDate"] = returnUnsignedBufValue(buf); break;
             case TimeScale:
                 xmpData_["Xmp.video.TimeScale"] = returnBufValue(buf);
-                timeScale_ = returnBufValue(buf); break;
+                timeScale_ = returnBufValue(buf);
+                if (timeScale_ <= 0) timeScale_ = 1;
+                break;
             case Duration:
                 if(timeScale_ != 0) // To prevent division by zero
                 xmpData_["Xmp.video.Duration"] = returnBufValue(buf) * 1000 / timeScale_; break;

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list