From 5a80715b5cab0ba8006928955c432b09acb3b1ff Mon Sep 17 00:00:00 2001 From: DrSlony Date: Sun, 15 Mar 2015 16:36:48 +0100 Subject: [PATCH] Segfault on opening TIFFs with empty Make and Model tags, issue 2713 --- rtengine/imagedata.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rtengine/imagedata.cc b/rtengine/imagedata.cc index f9829c0b6..00a478059 100644 --- a/rtengine/imagedata.cc +++ b/rtengine/imagedata.cc @@ -128,7 +128,8 @@ void ImageData::extractInfo () { } make.erase( make.find_last_not_of(' ')+1 ); } - if (root->getTag ("Model")){ + if (root->getTag ("Model")) + if( !(model.size()==0)) { model = root->getTag ("Model")->valueToString (); std::size_t i=0; if ( make.find("KODAK") != std::string::npos ){ @@ -147,6 +148,9 @@ void ImageData::extractInfo () { if( model.find( "Digital Camera ") != std::string::npos ) model.erase(0,15); } + else { + model = "Unknown"; + } if (root->getTag ("Orientation")){ orientation = root->getTag ("Orientation")->valueToString (); }