[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:28 UTC 2017
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=10db558
The following commit has been merged in the master branch:
commit 10db558646a6840ab6cf0302f322964386aaca01
Author: Andreas Huggel <ahuggel at gmx.net>
Date: Sat Jun 9 09:09:23 2007 +0000
Relaxed JPEG parser error handling. Fixes bugs #511 and #449.
---
src/error.cpp | 4 ++--
src/jpgimage.cpp | 25 ++++++++++++++++++++-----
2 files changed, 22 insertions(+), 7 deletions(-)
diff --git a/src/error.cpp b/src/error.cpp
index e22d8c8..6c6d900 100644
--- a/src/error.cpp
+++ b/src/error.cpp
@@ -77,8 +77,8 @@ namespace Exiv2 {
ErrMsg( 32, N_("Setting %1 in %2 images is not supported")), // %1=metadata type, %2=image format
ErrMsg( 33, N_("This does not look like a CRW image")),
ErrMsg( 34, N_("%1: Not supported")), // %1=function
- ErrMsg( 35, N_("ImageFactory registry full")),
- ErrMsg( 36, N_("Failed to decode %1 metadata")), // %1=type of metadata (Exif, IPTC)
+ // 35
+ // 36
ErrMsg( 37, N_("Size of %1 JPEG segment is larger than 65535 bytes")), // %1=type of metadata (Exif, IPTC, JPEG comment)
// Last error message (message is not used)
diff --git a/src/jpgimage.cpp b/src/jpgimage.cpp
index 8238743..f389add 100644
--- a/src/jpgimage.cpp
+++ b/src/jpgimage.cpp
@@ -207,7 +207,7 @@ namespace Exiv2 {
// Markers can start with any number of 0xff
while ((c=io_->getb()) == 0xff) {
- if (c == EOF) return -1;
+ if (c == EOF) return -2;
}
return c;
}
@@ -239,13 +239,18 @@ namespace Exiv2 {
if (marker == app1_ && memcmp(buf.pData_ + 2, exifId_, 6) == 0) {
if (size < 8) throw Error(15);
- // Seek to begining and read the Exif data
+ // Seek to beginning and read the Exif data
io_->seek(8-bufRead, BasicIo::cur);
long sizeExifData = size - 8;
DataBuf rawExif(sizeExifData);
io_->read(rawExif.pData_, sizeExifData);
if (io_->error() || io_->eof()) throw Error(14);
- if (exifData_.load(rawExif.pData_, sizeExifData)) throw Error(36, "Exif");
+ if (exifData_.load(rawExif.pData_, sizeExifData)) {
+#ifndef SUPPRESS_WARNINGS
+ std::cerr << "Warning: Failed to decode Exif metadata.
";
+#endif
+ exifData_.clear();
+ }
--search;
}
else if (marker == app13_ && memcmp(buf.pData_ + 2, Photoshop::ps3Id_, 14) == 0) {
@@ -262,7 +267,12 @@ namespace Exiv2 {
if (!Photoshop::locateIptcIrb(psData.pData_, psData.size_,
&record, &sizeHdr, &sizeIptc)) {
if (sizeIptc) {
- if (iptcData_.load(record + sizeHdr, sizeIptc)) throw Error(36, "IPTC");
+ if (iptcData_.load(record + sizeHdr, sizeIptc)) {
+#ifndef SUPPRESS_WARNINGS
+ std::cerr << "Warning: Failed to decode IPTC metadata.
";
+#endif
+ iptcData_.clear();
+ }
}
}
--search;
@@ -291,7 +301,12 @@ namespace Exiv2 {
}
// Read the beginning of the next segment
marker = advanceToMarker();
- if (marker < 0) throw Error(15);
+ if (marker < 0) {
+#ifndef SUPPRESS_WARNINGS
+ std::cerr << "Warning: JPEG format error.
";
+#endif
+ break;
+ }
}
} // JpegBase::readMetadata
--
exiv2 packaging
More information about the pkg-kde-commits
mailing list