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

Maximiliano Curia maxy at moszumanska.debian.org
Thu Jul 13 17:38:29 UTC 2017


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

The following commit has been merged in the master branch:
commit 7ba91c5c8f5215dd1e4e545591a73908a7401932
Author: Andreas Huggel <ahuggel at gmx.net>
Date:   Thu Jun 14 13:49:55 2007 +0000

    #511: Changed more throw Error(15) to warnings.
---
 src/jpgimage.cpp | 36 +++++++++++++++++++++++++++---------
 1 file changed, 27 insertions(+), 9 deletions(-)

diff --git a/src/jpgimage.cpp b/src/jpgimage.cpp
index f389add..d021350 100644
--- a/src/jpgimage.cpp
+++ b/src/jpgimage.cpp
@@ -214,6 +214,8 @@ namespace Exiv2 {
 
     void JpegBase::readMetadata()
     {
+        int rc = 0; // Todo: this should be the return value
+
         if (io_->open() != 0) throw Error(9, io_->path(), strError());
         IoCloser closer(*io_);
         // Ensure that this is the correct image type
@@ -238,7 +240,10 @@ namespace Exiv2 {
             uint16_t size = getUShort(buf.pData_, bigEndian);
 
             if (marker == app1_ && memcmp(buf.pData_ + 2, exifId_, 6) == 0) {
-                if (size < 8) throw Error(15);
+                if (size < 8) {
+                    rc = 1;
+                    break;
+                }
                 // Seek to beginning and read the Exif data
                 io_->seek(8-bufRead, BasicIo::cur);
                 long sizeExifData = size - 8;
@@ -253,8 +258,12 @@ namespace Exiv2 {
                 }
                 --search;
             }
-            else if (marker == app13_ && memcmp(buf.pData_ + 2, Photoshop::ps3Id_, 14) == 0) {
-                if (size < 16) throw Error(15);
+            else if (   marker == app13_
+                     && memcmp(buf.pData_ + 2, Photoshop::ps3Id_, 14) == 0) {
+                if (size < 16) {
+                    rc = 2;
+                    break;
+                }
                 // Read the rest of the APP13 segment
                 // needed if bufMinSize!=16: io_->seek(16-bufRead, BasicIo::cur);
                 DataBuf psData(size - 16);
@@ -279,7 +288,10 @@ namespace Exiv2 {
             }
             else if (marker == com_ && comment_.empty())
             {
-                if (size < 2) throw Error(15);
+                if (size < 2) {
+                    rc = 3;
+                    break;
+                }
                 // Jpegs can have multiple comments, but for now only read
                 // the first one (most jpegs only have one anyway). Comments
                 // are simple single byte ISO-8859-1 strings.
@@ -295,18 +307,24 @@ namespace Exiv2 {
                 --search;
             }
             else {
-                if (size < 2) throw Error(15);
+                if (size < 2) {
+                    rc = 4;
+                    break;
+                }
                 // Skip the remainder of the unknown segment
-                if (io_->seek(size-bufRead, BasicIo::cur)) throw Error(15);
+                if (io_->seek(size-bufRead, BasicIo::cur)) throw Error(14);
             }
             // Read the beginning of the next segment
             marker = advanceToMarker();
             if (marker < 0) {
-#ifndef SUPPRESS_WARNINGS
-                std::cerr << "Warning: JPEG format error.
";
-#endif
+                rc = 5;
                 break;
             }
+        } // while there are segments to process
+        if (rc != 0) {
+#ifndef SUPPRESS_WARNINGS
+            std::cerr << "Warning: JPEG format error, rc = " << rc << "
";
+#endif
         }
     } // JpegBase::readMetadata
 

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list