From 67301b471aa789a1fa4ac0e980bcace95b858c27 Mon Sep 17 00:00:00 2001 From: John Thacker Date: Fri, 9 Apr 2021 17:29:17 -0400 Subject: [PATCH] qcustomplot: Fix some clang code analysis warnings Two dead stores and a possible call of memcpy with a null destination. --- ui/qt/widgets/qcustomplot.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/qt/widgets/qcustomplot.cpp b/ui/qt/widgets/qcustomplot.cpp index bb4d3e2cff..c7816a5e68 100644 --- a/ui/qt/widgets/qcustomplot.cpp +++ b/ui/qt/widgets/qcustomplot.cpp @@ -25859,7 +25859,7 @@ QCPColorMapData &QCPColorMapData::operator=(const QCPColorMapData &other) if (!isEmpty()) { memcpy(mData, other.mData, sizeof(mData[0])*size_t(keySize*valueSize)); - if (mAlpha) + if (mAlpha && other.mAlpha) memcpy(mAlpha, other.mAlpha, sizeof(mAlpha[0])*size_t(keySize*valueSize)); } mDataBounds = other.mDataBounds; @@ -35434,13 +35434,13 @@ void QCPPolarGraph::getOptimizedLineData(QVector *lineData, const // to make fill not erratic, add last point normally if it was outside visible circle: if (aboveRange) { - aboveRange = false; + // aboveRange = false; // Dead store if (!reversed) lineData->append(*(it-1)); // just entered from above, draw previous point so entry angle is correct (if above means outer, so if not reversed axis) } if (belowRange) { - belowRange = false; + // belowRange = false; // Dead store if (reversed) lineData->append(*(it-1)); // just entered from below, draw previous point so entry angle is correct (if below means outer, so if reversed axis) }