aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Tilloy <olivier@tilloy.net>2012-04-22 20:53:16 +0200
committerOlivier Tilloy <olivier@tilloy.net>2012-04-22 20:53:16 +0200
commit1c43f604cb847d7a547ed22f12d97fe12b57a6cc (patch)
treef6b731d26f0be85bafa754315762a870c38eead6
parentb11f81e0591d101b90dfa73fdc2322106f8a2426 (diff)
downloadpyexiv2-1c43f604cb847d7a547ed22f12d97fe12b57a6cc.tar.gz
Check typeName for nullness.
-rw-r--r--src/exiv2wrapper.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/exiv2wrapper.cpp b/src/exiv2wrapper.cpp
index 8e7c3d4..f9eb579 100644
--- a/src/exiv2wrapper.cpp
+++ b/src/exiv2wrapper.cpp
@@ -559,7 +559,11 @@ ExifTag::ExifTag(const std::string& key,
// which we’d rather keep the 'Comment' type instead of 'Undefined'.
if ((_data != 0) && (_type != "Comment"))
{
- _type = _datum->typeName();
+ const char* typeName = _datum->typeName();
+ if (typeName != 0)
+ {
+ _type = typeName;
+ }
}
_name = exifKey.tagName();
_label = exifKey.tagLabel();
@@ -578,7 +582,11 @@ ExifTag::ExifTag(const std::string& key,
// which we’d rather keep the 'Comment' type instead of 'Undefined'.
if ((_data != 0) && (_type != "Comment"))
{
- _type = _datum->typeName();
+ const char* typeName = _datum->typeName();
+ if (typeName != 0)
+ {
+ _type = typeName;
+ }
}
_name = Exiv2::ExifTags::tagName(tag, ifd);
_label = Exiv2::ExifTags::tagLabel(tag, ifd);