Fix two coverity issues

This commit is contained in:
heckflosse
2018-11-17 01:30:59 +01:00
parent d66d8ce320
commit 50936b2447
2 changed files with 2 additions and 3 deletions

View File

@@ -2191,7 +2191,7 @@ bool Thumbnail::readEmbProfile (const Glib::ustring& fname)
if (!fseek (f, 0, SEEK_SET)) {
embProfileData = new unsigned char[embProfileLength];
fread (embProfileData, 1, embProfileLength, f);
embProfileLength = fread (embProfileData, 1, embProfileLength, f);
embProfile = cmsOpenProfileFromMem (embProfileData, embProfileLength);
}
}

View File

@@ -104,12 +104,11 @@ void parseKodakIfdTextualInfo (Tag *textualInfo, Tag* exif_)
a = atoi (val.c_str());
b = atoi (&p1[1]);
}
t = new Tag (exif, lookupAttrib (exifAttribs, "ExposureTime"));
t->initRational (a, b);
exif->replaceTag (t);
float ssv = -log2 ((float)a / (float)b); // convert to APEX value
const float ssv = -log2 ((float)a / std::max((float)b, 0.0001f)); // convert to APEX value, avoid division by zero
t = new Tag (exif, lookupAttrib (exifAttribs, "ShutterSpeedValue"));
t->initRational (1000000 * ssv, 1000000);
exif->replaceTag (t);