[SCM] exiv2 packaging branch, master, updated. debian/0.25-3.1-3734-gdcbc29a
Maximiliano Curia
maxy at moszumanska.debian.org
Thu Jul 13 17:39:16 UTC 2017
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=9cc886d
The following commit has been merged in the master branch:
commit 9cc886d1d6fbaf2fff2a8310988b4d99aadaad92
Author: Andreas Huggel <ahuggel at gmx.net>
Date: Sat Mar 29 06:14:56 2008 +0000
#546: Fixed floating point exception on invalid data.
---
src/nikonmn.cpp | 44 +++++++++++++++++++++++---------------------
1 file changed, 23 insertions(+), 21 deletions(-)
diff --git a/src/nikonmn.cpp b/src/nikonmn.cpp
index eafab48..7351e8f 100644
--- a/src/nikonmn.cpp
+++ b/src/nikonmn.cpp
@@ -931,29 +931,31 @@ namespace Exiv2 {
std::ostream& Nikon3MakerNote::print0x0084(std::ostream& os,
const Value& value)
{
- if (value.count() == 4) {
- long len1 = value.toLong(0);
- long len2 = value.toLong(1);
- Rational fno1 = value.toRational(2);
- Rational fno2 = value.toRational(3);
- os << len1;
- if (len2 != len1) {
- os << "-" << len2;
- }
- os << "mm ";
- std::ostringstream oss;
- oss.copyfmt(os);
- os << "F" << std::setprecision(2)
- << static_cast<float>(fno1.first) / fno1.second;
- if (fno2 != fno1) {
- os << "-" << std::setprecision(2)
- << static_cast<float>(fno2.first) / fno2.second;
- }
- os.copyfmt(oss);
- }
- else {
+ if ( value.count() != 4
+ || value.toRational(0).second == 0
+ || value.toRational(1).second == 0) {
os << "(" << value << ")";
+ return os;
+ }
+ long len1 = value.toLong(0);
+ long len2 = value.toLong(1);
+
+ Rational fno1 = value.toRational(2);
+ Rational fno2 = value.toRational(3);
+ os << len1;
+ if (len2 != len1) {
+ os << "-" << len2;
+ }
+ os << "mm ";
+ std::ostringstream oss;
+ oss.copyfmt(os);
+ os << "F" << std::setprecision(2)
+ << static_cast<float>(fno1.first) / fno1.second;
+ if (fno2 != fno1) {
+ os << "-" << std::setprecision(2)
+ << static_cast<float>(fno2.first) / fno2.second;
}
+ os.copyfmt(oss);
return os;
}
--
exiv2 packaging
More information about the pkg-kde-commits
mailing list