media-gfx/exiv2: Use edos2unix, restore keywords
[gentoo.git] / media-gfx / exiv2 / files / exiv2-0.26-pentaxnikon-crash.patch
1 From 2dc166b04ca6152d01bff6627a332e89ddef24d1 Mon Sep 17 00:00:00 2001
2 From: clanmills <robin@clanmills.com>
3 Date: Tue, 12 Sep 2017 09:14:42 +0100
4 Subject: [PATCH 1/2] Fix http://dev.exiv2.org/issues/1305
5
6 ---
7  src/pentaxmn.cpp | 2 ++
8  1 file changed, 2 insertions(+)
9
10 diff --git a/src/pentaxmn.cpp b/src/pentaxmn.cpp
11 index 4fc38be0..b22cb43b 100644
12 --- a/src/pentaxmn.cpp
13 +++ b/src/pentaxmn.cpp
14 @@ -1167,6 +1167,8 @@ namespace Exiv2 {
15  
16      std::ostream& PentaxMakerNote::printShutterCount(std::ostream& os, const Value& value, const ExifData* metadata)
17      {
18 +        if ( ! metadata ) return os << "undefined" ;
19 +
20          ExifData::const_iterator dateIt = metadata->findKey(
21                  ExifKey("Exif.PentaxDng.Date"));
22          if (dateIt == metadata->end()) {
23 -- 
24 2.13.6
25
26
27 From 3bc0b91bcecefdad531129b1a934be1251021c95 Mon Sep 17 00:00:00 2001
28 From: =?UTF-8?q?M=C4=81ris=20Narti=C5=A1s?= <mn@sungis.lv>
29 Date: Mon, 18 Sep 2017 23:37:40 +0300
30 Subject: [PATCH 2/2] Fix crash on undefined metadata on some Nikon images.
31  Identical to commit:5405d61623e82896e498c5c8342dd6f42e689115
32
33 ---
34  src/nikonmn.cpp | 2 ++
35  1 file changed, 2 insertions(+)
36
37 diff --git a/src/nikonmn.cpp b/src/nikonmn.cpp
38 index 571ab806..34bf601c 100644
39 --- a/src/nikonmn.cpp
40 +++ b/src/nikonmn.cpp
41 @@ -299,6 +299,8 @@ namespace Exiv2 {
42                                                 const Value& value,
43                                                 const ExifData* exifData)
44      {
45 +        if ( ! exifData ) return os << "undefined" ;
46 +
47          if ( value.count() >= 9 ) {
48              ByteOrder bo = getKeyString("Exif.MakerNote.ByteOrder",exifData) == "MM" ? bigEndian : littleEndian;
49              byte      p[4];
50 -- 
51 2.13.6
52