[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:14 UTC 2017


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

The following commit has been merged in the master branch:
commit 6f5032db37ed3c8c7c74e467dabe5f6dfad23d70
Author: Andreas Huggel <ahuggel at gmx.net>
Date:   Tue Dec 16 17:59:07 2008 +0000

    Do not access the first element of an empty vector.
---
 src/crwimage.cpp  | 2 +-
 src/exif.cpp      | 2 +-
 src/jpgimage.cpp  | 3 +--
 src/preview.cpp   | 2 +-
 src/tiffimage.cpp | 2 +-
 5 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/crwimage.cpp b/src/crwimage.cpp
index a91ecc5..0c9e9fe 100644
--- a/src/crwimage.cpp
+++ b/src/crwimage.cpp
@@ -164,7 +164,7 @@ namespace Exiv2 {
         // Write new buffer to file
         BasicIo::AutoPtr tempIo(io_->temporary()); // may throw
         assert(tempIo.get() != 0);
-        tempIo->write(&blob[0], static_cast<long>(blob.size()));
+        tempIo->write((blob.size() > 0 ? &blob[0] : 0), static_cast<long>(blob.size()));
         io_->close();
         io_->transfer(*tempIo); // may throw
 
diff --git a/src/exif.cpp b/src/exif.cpp
index 7c44904..34f799d 100644
--- a/src/exif.cpp
+++ b/src/exif.cpp
@@ -679,7 +679,7 @@ namespace {
         const Exiv2::IptcData emptyIptc;
         const Exiv2::XmpData  emptyXmp;
         Exiv2::TiffParser::encode(blob, 0, 0, Exiv2::littleEndian, thumb, emptyIptc, emptyXmp);
-        return Exiv2::DataBuf(&blob[0], static_cast<long>(blob.size()));
+        return Exiv2::DataBuf((blob.size() > 0 ? &blob[0] : 0), static_cast<long>(blob.size()));
     }
 
     const char* JpegThumbnail::mimeType() const
diff --git a/src/jpgimage.cpp b/src/jpgimage.cpp
index 05a2a3f..123569b 100644
--- a/src/jpgimage.cpp
+++ b/src/jpgimage.cpp
@@ -616,9 +616,8 @@ namespace Exiv2 {
                     const byte* pExifData = rawExif.pData_;
                     uint32_t exifSize = rawExif.size_;
                     if (wm == wmIntrusive) {
+                        pExifData = blob.size() > 0 ? &blob[0] : 0;
                         exifSize = static_cast<uint32_t>(blob.size());
-                        // Extra check to prevent MSVC debug assertion
-                        if (exifSize > 0) pExifData = &blob[0];
                     }
                     if (exifSize > 0) {
                         // Write APP1 marker, size of APP1 field, Exif id and Exif data
diff --git a/src/preview.cpp b/src/preview.cpp
index 17ac284..bb178fb 100644
--- a/src/preview.cpp
+++ b/src/preview.cpp
@@ -639,7 +639,7 @@ namespace {
         const IptcData emptyIptc;
         const XmpData  emptyXmp;
         TiffParser::encode(blob, 0, 0, Exiv2::littleEndian, preview, emptyIptc, emptyXmp);
-        return DataBuf(&blob[0], static_cast<long>(blob.size()));
+        return DataBuf((blob.size() > 0 ? &blob[0] : 0), static_cast<long>(blob.size()));
     }
 
 }                                       // namespace
diff --git a/src/tiffimage.cpp b/src/tiffimage.cpp
index 99e0bce..e8a2ed6 100644
--- a/src/tiffimage.cpp
+++ b/src/tiffimage.cpp
@@ -177,7 +177,7 @@ namespace Exiv2 {
         }
         else {
             // Size of the buffer changed, write from blob
-            tempIo->write(&blob[0], static_cast<long>(blob.size()));
+            tempIo->write((blob.size() > 0 ? &blob[0] : 0), static_cast<long>(blob.size()));
         }
         io_->close();
         io_->transfer(*tempIo); // may throw

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list