Fix coverity issues
This commit is contained in:
@@ -163,7 +163,7 @@ inline void RawImageSource::interpolate_row_rb (float* ar, float* ab, float* pg,
|
|||||||
n++;
|
n++;
|
||||||
}
|
}
|
||||||
|
|
||||||
nonGreen2[j] = cg[j] + nonGreen / n;
|
nonGreen2[j] = cg[j] + nonGreen / std::max(n, 1);
|
||||||
|
|
||||||
// linear R-G interp. horizontally
|
// linear R-G interp. horizontally
|
||||||
float val1;
|
float val1;
|
||||||
|
@@ -1207,8 +1207,8 @@ Tag::Tag (TagDirectory* p, FILE* f, int base)
|
|||||||
} else {
|
} else {
|
||||||
// read value
|
// read value
|
||||||
value = new unsigned char [valuesize + 1];
|
value = new unsigned char [valuesize + 1];
|
||||||
fread (value, 1, valuesize, f);
|
auto readSize = fread (value, 1, valuesize, f);
|
||||||
value[valuesize] = '\0';
|
value[readSize] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
// seek back to the saved position
|
// seek back to the saved position
|
||||||
@@ -2149,10 +2149,14 @@ void ExifManager::parseCIFF (int length, TagDirectory* root)
|
|||||||
char buffer[1024];
|
char buffer[1024];
|
||||||
Tag* t;
|
Tag* t;
|
||||||
|
|
||||||
fseek (f, rml->ciffBase + length - 4, SEEK_SET);
|
if (fseek(f, rml->ciffBase + length - 4, SEEK_SET)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int dirStart = get4 (f, INTEL) + rml->ciffBase;
|
int dirStart = get4 (f, INTEL) + rml->ciffBase;
|
||||||
fseek (f, dirStart, SEEK_SET);
|
if (fseek(f, dirStart, SEEK_SET)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int numOfTags = get2 (f, INTEL);
|
int numOfTags = get2 (f, INTEL);
|
||||||
|
|
||||||
|
@@ -203,7 +203,9 @@ int main (int argc, char **argv)
|
|||||||
|
|
||||||
// Move the old path to the new one if the new does not exist
|
// Move the old path to the new one if the new does not exist
|
||||||
if (Glib::file_test (Glib::build_filename (options.rtdir, "cache"), Glib::FILE_TEST_IS_DIR) && !Glib::file_test (options.cacheBaseDir, Glib::FILE_TEST_IS_DIR)) {
|
if (Glib::file_test (Glib::build_filename (options.rtdir, "cache"), Glib::FILE_TEST_IS_DIR) && !Glib::file_test (options.cacheBaseDir, Glib::FILE_TEST_IS_DIR)) {
|
||||||
g_rename (Glib::build_filename (options.rtdir, "cache").c_str (), options.cacheBaseDir.c_str ());
|
if (g_rename (Glib::build_filename (options.rtdir, "cache").c_str (), options.cacheBaseDir.c_str ()) == -1) {
|
||||||
|
std::cout << "g_rename " << Glib::build_filename (options.rtdir, "cache").c_str () << " => " << options.cacheBaseDir.c_str () << " failed." << std::endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user