A few more minor fixes geared towards lgtm.com alerts (#6127)
* Remove unfilled formatting placeholders in KLT parser. * Fix presumably unintentionally missing reference on PlanatPtr and ChunkyPtr call operators. * Fix catching pointer and make use-after-free of workimg easier to spot. Make sure all of our thrown exceptions derive from std::exception and then catch by reference instead of by pointer. * Fix mismatch between array form new and non-array form delete. * Simplify memory management of embedded color profiles by unifying allocation to use operator new.
This commit is contained in:
@@ -5622,14 +5622,8 @@ double ImProcFunctions::getAutoDistor(const Glib::ustring &fname, int thumb_size
|
||||
rawGray = raw->getGrayscaleHistEQ(width);
|
||||
|
||||
if (!thumbGray || !rawGray) {
|
||||
if (thumbGray) {
|
||||
delete thumbGray;
|
||||
}
|
||||
|
||||
if (rawGray) {
|
||||
delete rawGray;
|
||||
}
|
||||
|
||||
delete[] thumbGray;
|
||||
delete[] rawGray;
|
||||
delete thumb;
|
||||
delete raw;
|
||||
return 0.0;
|
||||
@@ -5642,8 +5636,8 @@ double ImProcFunctions::getAutoDistor(const Glib::ustring &fname, int thumb_size
|
||||
calcDistortion(thumbGray, rawGray, width, h_thumb, 4, dist_amount);
|
||||
}
|
||||
|
||||
delete thumbGray;
|
||||
delete rawGray;
|
||||
delete[] thumbGray;
|
||||
delete[] rawGray;
|
||||
delete thumb;
|
||||
delete raw;
|
||||
return dist_amount;
|
||||
|
Reference in New Issue
Block a user