QCustomPlot: Fix some clang code analysis warnings

Two dead stores and a possible call of memcpy with a null
destination.

(cherry picked from commit 67301b471a)
This commit is contained in:
John Thacker 2021-04-09 17:29:17 -04:00
parent f60e35e481
commit 117fa55c04
1 changed files with 3 additions and 3 deletions

View File

@ -25895,7 +25895,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;
@ -35471,13 +35471,13 @@ void QCPPolarGraph::getOptimizedLineData(QVector<QCPGraphData> *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)
}