New Defects reported by Coverity Scan for digiKam
scan-admin at coverity.com
scan-admin at coverity.com
Wed Dec 25 22:09:16 GMT 2024
Hi,
Please find the latest report on new defect(s) introduced to digiKam found with Coverity Scan.
16 new defect(s) introduced to digiKam found with Coverity Scan.
5 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent build analyzed by Coverity Scan.
New defect(s) Reported-by: Coverity Scan
Showing 16 of 16 defect(s)
** CID 1637072: Null pointer dereferences (FORWARD_NULL)
________________________________________________________________________________________________________
*** CID 1637072: Null pointer dereferences (FORWARD_NULL)
/home/gilles/Devel/8.x/core/utilities/facemanagement/pipelines/facepipelinebase.cpp: 93 in Digikam::FacePipelineBase::commonFaceThumbnailLoader(const QString &, Digikam::MLPipelineFoundation::MLPipelineStage, Digikam::MLPipelineFoundation::MLPipelineStage)()
87 {
88 // end of queue signal
89
90 break;
91 }
92
>>> CID 1637072: Null pointer dereferences (FORWARD_NULL)
>>> Passing null pointer "thisQueue" to "size", which dereferences it.
93 performanceProfileList[thisStage].maxQueueCount = qMax(performanceProfileList[thisStage].maxQueueCount, thisQueue->size());
94 ++performanceProfileList[thisStage].itemCount;
95
96 timer.start();
97
98 //////////////////////////////////////////////////////////////////////////////////////////////
** CID 1637071: Null pointer dereferences (FORWARD_NULL)
________________________________________________________________________________________________________
*** CID 1637071: Null pointer dereferences (FORWARD_NULL)
/home/gilles/Devel/8.x/core/utilities/facemanagement/pipelines/detectrecognize/facepipelinedetectrecognize.cpp: 256 in Digikam::FacePipelineDetectRecognize::loader()()
250 {
251 // end of queue signal
252
253 break;
254 }
255
>>> CID 1637071: Null pointer dereferences (FORWARD_NULL)
>>> Passing null pointer "thisQueue" to "size", which dereferences it.
256 performanceProfileList[MLPipelineStage::Loader].maxQueueCount = qMax(performanceProfileList[MLPipelineStage::Loader].maxQueueCount, thisQueue->size());
257 ++performanceProfileList[MLPipelineStage::Loader].itemCount;
258
259 timer.start();
260
261 //////////////////////////////////////////////////////////////////////////////////////////////
** CID 1637070: Null pointer dereferences (FORWARD_NULL)
________________________________________________________________________________________________________
*** CID 1637070: Null pointer dereferences (FORWARD_NULL)
/home/gilles/Devel/8.x/core/utilities/facemanagement/pipelines/detectrecognize/facepipelinedetectrecognize.cpp: 359 in Digikam::FacePipelineDetectRecognize::extractor()()
353 {
354 // end of queue signal
355
356 break;
357 }
358
>>> CID 1637070: Null pointer dereferences (FORWARD_NULL)
>>> Passing null pointer "thisQueue" to "size", which dereferences it.
359 performanceProfileList[MLPipelineStage::Extractor].maxQueueCount = qMax(performanceProfileList[MLPipelineStage::Extractor].maxQueueCount, thisQueue->size());
360 ++performanceProfileList[MLPipelineStage::Extractor].itemCount;
361
362 timer.start();
363
364 //////////////////////////////////////////////////////////////////////////////////////////////
** CID 1637069: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/gilles/Devel/8.x/core/libs/facesengine/recognition/opencv-dnn/dnnsfaceextractor.cpp: 72 in Digikam::DNNSFaceExtractor::DNNSFaceExtractor()()
________________________________________________________________________________________________________
*** CID 1637069: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/gilles/Devel/8.x/core/libs/facesengine/recognition/opencv-dnn/dnnsfaceextractor.cpp: 72 in Digikam::DNNSFaceExtractor::DNNSFaceExtractor()()
66 qCCritical(DIGIKAM_FACEDB_LOG) << "Failed to load SFace model";
67 std::runtime_error e("Failed to load SFace model");
68
69 #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
70
71 std::exception_ptr p = std::make_exception_ptr(e);
>>> CID 1637069: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "p" is passed-by-value as parameter to "QUnhandledException::QUnhandledException(std::__exception_ptr::exception_ptr)" when it could be moved instead.
72 QUnhandledException(p).raise();
73
74 #else
75
76 QUnhandledException().raise();
77
** CID 1637068: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/gilles/Devel/8.x/core/libs/facesengine/detection/opencv-dnn/dnnfacedetectoryunet.cpp: 67 in Digikam::DNNFaceDetectorYuNet::DNNFaceDetectorYuNet()()
________________________________________________________________________________________________________
*** CID 1637068: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/gilles/Devel/8.x/core/libs/facesengine/detection/opencv-dnn/dnnfacedetectoryunet.cpp: 67 in Digikam::DNNFaceDetectorYuNet::DNNFaceDetectorYuNet()()
61 qCCritical(DIGIKAM_FACESENGINE_LOG) << "Failed to load YuNet model";
62 std::runtime_error e("Failed to load YuNet model");
63
64 #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
65
66 std::exception_ptr p = std::make_exception_ptr(e);
>>> CID 1637068: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "p" is passed-by-value as parameter to "QUnhandledException::QUnhandledException(std::__exception_ptr::exception_ptr)" when it could be moved instead.
67 QUnhandledException(p).raise();
68
69 #else
70
71 QUnhandledException().raise();
72
** CID 1637067: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/gilles/Devel/8.x/core/libs/qtopencvimg/qtopencvimg.cpp: 350 in Digikam::image2Mat(const QImage &, int, Digikam::MatColorOrder)()
________________________________________________________________________________________________________
*** CID 1637067: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/gilles/Devel/8.x/core/libs/qtopencvimg/qtopencvimg.cpp: 350 in Digikam::image2Mat(const QImage &, int, Digikam::MatColorOrder)()
344 {
345 return (mat_adjustCn.empty() ? mat0.clone() : mat_adjustCn);
346 }
347
348 if (mat_adjustCn.empty())
349 {
>>> CID 1637067: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "mat0" is copied in a call to copy assignment "operator =", when it could be moved instead.
350 mat_adjustCn = mat0;
351 }
352
353 cv::Mat mat_adjustDepth;
354 mat_adjustCn.convertTo(mat_adjustDepth,
355 CV_MAKE_TYPE(targetDepth, mat_adjustCn.channels()),
** CID 1637066: Null pointer dereferences (FORWARD_NULL)
________________________________________________________________________________________________________
*** CID 1637066: Null pointer dereferences (FORWARD_NULL)
/home/gilles/Devel/8.x/core/utilities/facemanagement/pipelines/detectrecognize/facepipelinedetectrecognize.cpp: 581 in Digikam::FacePipelineDetectRecognize::classifier()()
575 {
576 // end of queue signal
577
578 break;
579 }
580
>>> CID 1637066: Null pointer dereferences (FORWARD_NULL)
>>> Passing null pointer "thisQueue" to "size", which dereferences it.
581 performanceProfileList[MLPipelineStage::Classifier].maxQueueCount = qMax(performanceProfileList[MLPipelineStage::Classifier].maxQueueCount, thisQueue->size());
582 ++performanceProfileList[MLPipelineStage::Classifier].itemCount;
583
584 timer.start();
585
586 //////////////////////////////////////////////////////////////////////////////////////////////
** CID 1637065: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/gilles/Devel/8.x/core/libs/facesengine/recognition/opencv-dnn/dnnsfaceextractor.cpp: 71 in Digikam::DNNSFaceExtractor::DNNSFaceExtractor()()
________________________________________________________________________________________________________
*** CID 1637065: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/gilles/Devel/8.x/core/libs/facesengine/recognition/opencv-dnn/dnnsfaceextractor.cpp: 71 in Digikam::DNNSFaceExtractor::DNNSFaceExtractor()()
65 {
66 qCCritical(DIGIKAM_FACEDB_LOG) << "Failed to load SFace model";
67 std::runtime_error e("Failed to load SFace model");
68
69 #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
70
>>> CID 1637065: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "e" is passed-by-value as parameter to "make_exception_ptr" when it could be moved instead.
71 std::exception_ptr p = std::make_exception_ptr(e);
72 QUnhandledException(p).raise();
73
74 #else
75
76 QUnhandledException().raise();
** CID 1637064: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/gilles/Devel/8.x/core/libs/facesengine/detection/opencv-dnn/dnnfacedetectoryunet.cpp: 66 in Digikam::DNNFaceDetectorYuNet::DNNFaceDetectorYuNet()()
________________________________________________________________________________________________________
*** CID 1637064: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/gilles/Devel/8.x/core/libs/facesengine/detection/opencv-dnn/dnnfacedetectoryunet.cpp: 66 in Digikam::DNNFaceDetectorYuNet::DNNFaceDetectorYuNet()()
60 {
61 qCCritical(DIGIKAM_FACESENGINE_LOG) << "Failed to load YuNet model";
62 std::runtime_error e("Failed to load YuNet model");
63
64 #if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
65
>>> CID 1637064: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "e" is passed-by-value as parameter to "make_exception_ptr" when it could be moved instead.
66 std::exception_ptr p = std::make_exception_ptr(e);
67 QUnhandledException(p).raise();
68
69 #else
70
71 QUnhandledException().raise();
** CID 1637063: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/gilles/Devel/8.x/core/libs/facesengine/recognition/faceclassifier.cpp: 296 in Digikam::FaceClassifier::loadTrainingData()()
________________________________________________________________________________________________________
*** CID 1637063: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/gilles/Devel/8.x/core/libs/facesengine/recognition/faceclassifier.cpp: 296 in Digikam::FaceClassifier::loadTrainingData()()
290 }
291
292 d->trainingLock.lockForWrite();
293
294 d->knnClassifier = knn;
295 d->svmClassifier = svm;
>>> CID 1637063: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "identityFeatures" is copied in a call to copy assignment "operator =", when it could be moved instead.
296 d->identityFeatures = identityFeatures;
297
298 d->ready = true;
299
300 d->trainingLock.unlock();
301 }
** CID 1637062: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/gilles/Devel/8.x/core/utilities/facemanagement/pipelines/facepipelinebase.cpp: 219 in Digikam::FacePipelineBase::commonFaceThumbnailExtractor(const QString &, Digikam::MLPipelineFoundation::MLPipelineStage, Digikam::MLPipelineFoundation::MLPipelineStage)()
________________________________________________________________________________________________________
*** CID 1637062: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/gilles/Devel/8.x/core/utilities/facemanagement/pipelines/facepipelinebase.cpp: 219 in Digikam::FacePipelineBase::commonFaceThumbnailExtractor(const QString &, Digikam::MLPipelineFoundation::MLPipelineStage, Digikam::MLPipelineFoundation::MLPipelineStage)()
213 uImage = mImage;
214 // inputImage.detach();
215 cv::cvtColor(uImage, cvImage, CV_RGBA2RGB);
216
217 uFeatures = extractor.getFaceEmbedding(cvImage);
218
>>> CID 1637062: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "uFeatures" is copied in a call to copy assignment "operator =", when it could be moved instead.
219 package->features = uFeatures;
220
221 enqueue(nextQueue, package);
222
223 // if (0 == uFeatures.rows)
224 // {
** CID 1637061: Null pointer dereferences (FORWARD_NULL)
________________________________________________________________________________________________________
*** CID 1637061: Null pointer dereferences (FORWARD_NULL)
/home/gilles/Devel/8.x/core/libs/mlfoundation/mlpipelinefoundation.cpp: 504 in Digikam::MLPipelineFoundation::stageStart(QThread::Priority, Digikam::MLPipelineFoundation::MLPipelineStage, Digikam::MLPipelineFoundation::MLPipelineStage, Digikam::SharedQueue<Digikam::MLPipelinePackageFoundation *> *&, Digikam::SharedQueue<Digikam::MLPipelinePackageFoundation *> *&)()
498
499 // no throttle on loader queue since it's only IDs
500 // otherwise throttle to the ideal thread count
501
502 if (MLPipelineStage::Loader != thisStage)
503 {
>>> CID 1637061: Null pointer dereferences (FORWARD_NULL)
>>> Passing null pointer "thisQueue" to "maxDepth", which dereferences it.
504 thisQueue->maxDepth(QThread::idealThreadCount());
505 }
506 }
507
508 if (MLPipelineStage::None != nextStage)
509 {
** CID 1637060: (COPY_INSTEAD_OF_MOVE)
/home/gilles/Devel/8.x/core/libs/qtopencvimg/qtopencvimg.cpp: 313 in Digikam::image2Mat(const QImage &, int, Digikam::MatColorOrder)()
/home/gilles/Devel/8.x/core/libs/qtopencvimg/qtopencvimg.cpp: 294 in Digikam::image2Mat(const QImage &, int, Digikam::MatColorOrder)()
________________________________________________________________________________________________________
*** CID 1637060: (COPY_INSTEAD_OF_MOVE)
/home/gilles/Devel/8.x/core/libs/qtopencvimg/qtopencvimg.cpp: 313 in Digikam::image2Mat(const QImage &, int, Digikam::MatColorOrder)()
307 else if (mat0.channels() == 3)
308 {
309 if (requriedOrder == MCO_ARGB)
310 {
311 cv::Mat alphaMat(mat0.rows, mat0.cols, CV_MAKE_TYPE(mat0.type(), 1), cv::Scalar(maxAlpha));
312 mat_adjustCn = cv::Mat(mat0.rows, mat0.cols, CV_MAKE_TYPE(mat0.type(), 4));
>>> CID 1637060: (COPY_INSTEAD_OF_MOVE)
>>> "alphaMat" is copied in call to copy constructor "cv::Mat", when it could be moved instead.
313 cv::Mat in[] = { alphaMat, mat0 };
314 int from_to[] = { 0, 0, 1, 1, 2, 2, 3, 3 };
315 cv::mixChannels(in, 2, &mat_adjustCn, 1, from_to, 4);
316 }
317 else if (requriedOrder == MCO_RGBA)
318 {
/home/gilles/Devel/8.x/core/libs/qtopencvimg/qtopencvimg.cpp: 294 in Digikam::image2Mat(const QImage &, int, Digikam::MatColorOrder)()
288 if (mat0.channels() == 1)
289 {
290 if (requriedOrder == MCO_ARGB)
291 {
292 cv::Mat alphaMat(mat0.rows, mat0.cols, CV_MAKE_TYPE(mat0.type(), 1), cv::Scalar(maxAlpha));
293 mat_adjustCn = cv::Mat(mat0.rows, mat0.cols, CV_MAKE_TYPE(mat0.type(), 4));
>>> CID 1637060: (COPY_INSTEAD_OF_MOVE)
>>> "alphaMat" is copied in call to copy constructor "cv::Mat", when it could be moved instead.
294 cv::Mat in[] = {alphaMat, mat0};
295 int from_to[] = {0, 0, 1, 1, 1, 2, 1, 3};
296 cv::mixChannels(in, 2, &mat_adjustCn, 1, from_to, 4);
297 }
298 else if (requriedOrder == MCO_RGBA)
299 {
** CID 1637059: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/gilles/Devel/8.x/core/utilities/facemanagement/pipelines/facepipelinebase.cpp: 213 in Digikam::FacePipelineBase::commonFaceThumbnailExtractor(const QString &, Digikam::MLPipelineFoundation::MLPipelineStage, Digikam::MLPipelineFoundation::MLPipelineStage)()
________________________________________________________________________________________________________
*** CID 1637059: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/home/gilles/Devel/8.x/core/utilities/facemanagement/pipelines/facepipelinebase.cpp: 213 in Digikam::FacePipelineBase::commonFaceThumbnailExtractor(const QString &, Digikam::MLPipelineFoundation::MLPipelineStage, Digikam::MLPipelineFoundation::MLPipelineStage)()
207 {
208 inputImage = inputImage.convertToFormat(QImage::Format_ARGB32_Premultiplied);
209 }
210
211 mImage = cv::Mat(inputImage.height(), inputImage.width(), CV_8UC4, inputImage.scanLine(0), inputImage.bytesPerLine()); //.getUMat(cv::ACCESS_RW);
212 // uImage = mImage.getUMat(cv::ACCESS_RW);
>>> CID 1637059: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "mImage" is copied in a call to copy assignment "operator =", when it could be moved instead.
213 uImage = mImage;
214 // inputImage.detach();
215 cv::cvtColor(uImage, cvImage, CV_RGBA2RGB);
216
217 uFeatures = extractor.getFaceEmbedding(cvImage);
218
** CID 1637058: Null pointer dereferences (FORWARD_NULL)
________________________________________________________________________________________________________
*** CID 1637058: Null pointer dereferences (FORWARD_NULL)
/home/gilles/Devel/8.x/core/utilities/facemanagement/pipelines/facepipelinebase.cpp: 193 in Digikam::FacePipelineBase::commonFaceThumbnailExtractor(const QString &, Digikam::MLPipelineFoundation::MLPipelineStage, Digikam::MLPipelineFoundation::MLPipelineStage)()
187 {
188 // end of queue signal
189
190 break;
191 }
192
>>> CID 1637058: Null pointer dereferences (FORWARD_NULL)
>>> Passing null pointer "thisQueue" to "size", which dereferences it.
193 performanceProfileList[MLPipelineStage::Extractor].maxQueueCount = qMax(performanceProfileList[MLPipelineStage::Extractor].maxQueueCount, thisQueue->size());
194 ++performanceProfileList[MLPipelineStage::Extractor].itemCount;
195
196 timer.start();
197
198 //////////////////////////////////////////////////////////////////////////////////////////////
** CID 1637057: Null pointer dereferences (FORWARD_NULL)
________________________________________________________________________________________________________
*** CID 1637057: Null pointer dereferences (FORWARD_NULL)
/home/gilles/Devel/8.x/core/utilities/facemanagement/pipelines/recognize/facepipelinerecognize.cpp: 234 in Digikam::FacePipelineRecognize::classifier()()
228 {
229 // end of queue signal
230
231 break;
232 }
233
>>> CID 1637057: Null pointer dereferences (FORWARD_NULL)
>>> Passing null pointer "thisQueue" to "size", which dereferences it.
234 performanceProfileList[MLPipelineStage::Classifier].maxQueueCount = qMax(performanceProfileList[MLPipelineStage::Classifier].maxQueueCount, thisQueue->size());
235 ++performanceProfileList[MLPipelineStage::Classifier].itemCount;
236
237 timer.start();
238
239 //////////////////////////////////////////////////////////////////////////////////////////////
________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u15810271.ct.sendgrid.net/ls/click?upn=u001.AxU2LYlgjL6eX23u9ErQy-2BKADyCpvUKOL6EWmZljiu4yJUfIaFVfulX1EnArvLvmGJ18AyhOhOJnWywYkUuR-2BHL458rbL5b5DiAzhSjilZ8-3Dbhcn_wUwU8mg96yc-2FA1IAMQ6mJ-2FFdQ9EM-2BFY-2BXFbSpXNYnfyLqxCsgHZCfgVhTv-2B5c4wqKFJao67jwn6C7oGuWqzx18XBHyT8KauQENeUqRPsceFCZJUJ73gtddjV9B2H9nQicLRXggPBWT7p10PWDvY8ZItydz1iEo5SI1tuxHmsoIJVDUAM2ZPlfJrHqxS34xNvuASJJ24JwL80uhkh7ykM5w-3D-3D
More information about the Digikam-devel
mailing list