Fix some coverity issues

This commit is contained in:
heckflosse 2017-06-14 17:02:33 +02:00
parent 31d1f2f52b
commit c4f27b2c13
12 changed files with 16 additions and 15 deletions

View File

@ -180,11 +180,10 @@ CameraConst::parseLevels(CameraConst *cc, int bw, void *ji_)
CameraConst * CameraConst *
CameraConst::parseEntry(void *cJSON_, const char *make_model) CameraConst::parseEntry(void *cJSON_, const char *make_model)
{ {
CameraConst *cc = nullptr;
cJSON *js, *ji, *jranges; cJSON *js, *ji, *jranges;
js = (cJSON *)cJSON_; js = (cJSON *)cJSON_;
cc = new CameraConst; CameraConst *cc = new CameraConst;
cc->make_model = Glib::ustring(make_model); cc->make_model = Glib::ustring(make_model);
ji = cJSON_GetObjectItem(js, "dcraw_matrix"); ji = cJSON_GetObjectItem(js, "dcraw_matrix");

View File

@ -1225,8 +1225,7 @@ cmsHPROFILE rtengine::ICCStore::createCustomGammaOutputProfile(const procparams:
} }
// Calculate output profile's rTRC gTRC bTRC // Calculate output profile's rTRC gTRC bTRC
cmsToneCurve* GammaTRC = nullptr; cmsToneCurve* GammaTRC = cmsBuildParametricToneCurve(nullptr, 5, Parameters);
GammaTRC = cmsBuildParametricToneCurve(nullptr, 5, Parameters);
cmsWriteTag(outputProfile, cmsSigRedTRCTag,(void*)GammaTRC ); cmsWriteTag(outputProfile, cmsSigRedTRCTag,(void*)GammaTRC );
cmsWriteTag(outputProfile, cmsSigGreenTRCTag,(void*)GammaTRC ); cmsWriteTag(outputProfile, cmsSigGreenTRCTag,(void*)GammaTRC );
cmsWriteTag(outputProfile, cmsSigBlueTRCTag,(void*)GammaTRC ); cmsWriteTag(outputProfile, cmsSigBlueTRCTag,(void*)GammaTRC );

View File

@ -150,7 +150,7 @@ class ImProcFunctions
} }
double rd; double rd;
double yr[4]; double yr[4] = {0.0};
for (int k = ys, kx = 0; k < ys + 4; k++, kx++) { for (int k = ys, kx = 0; k < ys + 4; k++, kx++) {
rd = 0.0; rd = 0.0;

View File

@ -690,7 +690,7 @@ void ImProcFunctions::transformLuminanceOnly (Imagefloat* original, Imagefloat*
#pragma omp parallel for schedule(dynamic,16) if (multiThread) #pragma omp parallel for schedule(dynamic,16) if (multiThread)
for (int y = 0; y < transformed->getHeight(); y++) { for (int y = 0; y < transformed->getHeight(); y++) {
double vig_y_d = (double) (y + cy) - vig_h2 ; double vig_y_d = applyVignetting ? (double) (y + cy) - vig_h2 : 0.0;
for (int x = 0; x < transformed->getWidth(); x++) { for (int x = 0; x < transformed->getWidth(); x++) {
double factor = 1.0; double factor = 1.0;

View File

@ -819,6 +819,7 @@ void DirPyrDenoiseParams::setDefaults()
enhance = false; enhance = false;
median = false; median = false;
autochroma = false; autochroma = false;
perform = false;
luma = 0; luma = 0;
passes = 1; passes = 1;
dmethod = "Lab"; dmethod = "Lab";

View File

@ -190,8 +190,7 @@ bool ProfileStore::parseDir (Glib::ustring& realPath, Glib::ustring& virtualPath
} }
// walking through the directory // walking through the directory
Glib::Dir* dir = nullptr; Glib::Dir* dir = new Glib::Dir (realPath);
dir = new Glib::Dir (realPath);
for (Glib::DirIterator i = dir->begin(); i != dir->end(); ++i) { for (Glib::DirIterator i = dir->begin(); i != dir->end(); ++i) {
currDir = *i; currDir = *i;

View File

@ -36,7 +36,7 @@ using namespace rtengine;
CropWindow::CropWindow (ImageArea* parent, bool isLowUpdatePriority_, bool isDetailWindow) CropWindow::CropWindow (ImageArea* parent, bool isLowUpdatePriority_, bool isDetailWindow)
: ObjectMOBuffer(parent), state(SNormal), press_x(0), press_y(0), action_x(0), action_y(0), pickedObject(-1), pickModifierKey(0), rot_deg(0), onResizeArea(false), deleted(false), : ObjectMOBuffer(parent), state(SNormal), press_x(0), press_y(0), action_x(0), action_y(0), pickedObject(-1), pickModifierKey(0), rot_deg(0), onResizeArea(false), deleted(false),
fitZoomEnabled(true), fitZoom(false), /*isLowUpdatePriority(isLowUpdatePriority_),*/ hoveredPicker(nullptr), cropLabel(Glib::ustring("100%")), fitZoomEnabled(true), fitZoom(false), cursor_type(CSArrow), /*isLowUpdatePriority(isLowUpdatePriority_),*/ hoveredPicker(nullptr), cropLabel(Glib::ustring("100%")),
backColor(options.bgcolor), decorated(true), isFlawnOver(false), titleHeight(30), sideBorderWidth(3), lowerBorderWidth(3), backColor(options.bgcolor), decorated(true), isFlawnOver(false), titleHeight(30), sideBorderWidth(3), lowerBorderWidth(3),
upperBorderWidth(1), sepWidth(2), xpos(30), ypos(30), width(0), height(0), imgAreaX(0), imgAreaY(0), imgAreaW(0), imgAreaH(0), upperBorderWidth(1), sepWidth(2), xpos(30), ypos(30), width(0), height(0), imgAreaX(0), imgAreaY(0), imgAreaW(0), imgAreaH(0),
imgX(-1), imgY(-1), imgW(1), imgH(1), iarea(parent), cropZoom(0), zoomVersion(0), exposeVersion(0), cropgl(nullptr), imgX(-1), imgY(-1), imgW(1), imgH(1), iarea(parent), cropZoom(0), zoomVersion(0), exposeVersion(0), cropgl(nullptr),
@ -1619,8 +1619,8 @@ void CropWindow::expose (Cairo::RefPtr<Cairo::Context> cr)
const int hlThreshold = options.highlightThreshold; const int hlThreshold = options.highlightThreshold;
const int shThreshold = options.shadowThreshold; const int shThreshold = options.shadowThreshold;
const float ShawdowFac = 64 / (options.shadowThreshold + 1); const float ShawdowFac = 64.f / (options.shadowThreshold + 1);
const float HighlightFac = 64 / (256 - options.highlightThreshold); const float HighlightFac = 64.f / (256 - options.highlightThreshold);
const bool showclippedAny = (!showR && !showG && !showB && !showL); // will show clipping if any of RGB chanels is clipped const bool showclippedAny = (!showR && !showG && !showB && !showL); // will show clipping if any of RGB chanels is clipped
#ifdef _OPENMP #ifdef _OPENMP

View File

@ -197,8 +197,11 @@ CurveEditor::CurveEditor (Glib::ustring text, CurveEditorGroup* ceGroup, CurveEd
remoteDrag = false; remoteDrag = false;
selected = DCT_Linear; selected = DCT_Linear;
bottomBarCP = nullptr; bottomBarCP = nullptr;
bottomBarCId = 0;
leftBarCP = nullptr; leftBarCP = nullptr;
leftBarCId = 0;
curveCP = nullptr; curveCP = nullptr;
curveCId = 0;
relatedWidget = nullptr; relatedWidget = nullptr;
expandRelatedWidget = true; expandRelatedWidget = true;

View File

@ -395,7 +395,7 @@ void CurveEditorGroup::setUnChanged (bool uc, CurveEditor* ce)
} }
} }
CurveEditorSubGroup::CurveEditorSubGroup(Glib::ustring& curveDir) : curveDir(curveDir), lastFilename("") CurveEditorSubGroup::CurveEditorSubGroup(Glib::ustring& curveDir) : curveDir(curveDir), lastFilename(""), valLinear(0), valUnchanged(0), parent(nullptr)
{ {
leftBar = nullptr; leftBar = nullptr;
bottomBar = nullptr; bottomBar = nullptr;

View File

@ -25,7 +25,7 @@
using namespace rtengine; using namespace rtengine;
using namespace rtengine::procparams; using namespace rtengine::procparams;
DarkFrame::DarkFrame () : FoldableToolPanel(this, "darkframe", M("TP_DARKFRAME_LABEL")) DarkFrame::DarkFrame () : FoldableToolPanel(this, "darkframe", M("TP_DARKFRAME_LABEL")), dfChanged(false), lastDFauto(false), dfp(nullptr), israw(true)
{ {
hbdf = Gtk::manage(new Gtk::HBox()); hbdf = Gtk::manage(new Gtk::HBox());
hbdf->set_spacing(4); hbdf->set_spacing(4);

View File

@ -226,7 +226,7 @@ void PreviewModePanel::buttonToggled (Gtk::ToggleButton* tbpreview)
int PreviewModePanel::GetbackColor() int PreviewModePanel::GetbackColor()
{ {
int backColor; int backColor = 0;
if (backColor0->get_active ()) { if (backColor0->get_active ()) {
backColor = 0; backColor = 0;

View File

@ -22,7 +22,7 @@
#include "cursormanager.h" #include "cursormanager.h"
PreviewWindow::PreviewWindow () : previewHandler(nullptr), mainCropWin(nullptr), imageArea(nullptr), imgX(0), imgY(0), imgW(0), imgH(0), PreviewWindow::PreviewWindow () : previewHandler(nullptr), mainCropWin(nullptr), imageArea(nullptr), imgX(0), imgY(0), imgW(0), imgH(0),
zoom(0.0), isMoving(false), needsUpdate(false), cursor_type(CSUndefined) zoom(0.0), press_x(0), press_y(0), isMoving(false), needsUpdate(false), cursor_type(CSUndefined)
{ {
set_name("PreviewWindow"); set_name("PreviewWindow");