[Digikam-devel] Fwd: New Defects reported by Coverity Scan for digiKam
Gilles Caulier
caulier.gilles at gmail.com
Fri May 31 10:02:33 BST 2013
---------- Forwarded message ----------
From: <scan-admin at coverity.com>
Date: 2013/5/31
Subject: New Defects reported by Coverity Scan for digiKam
To: caulier.gilles at gmail.com
Hi,
Please find the latest report on new defect(s) introduced to digiKam found
with Coverity Scan
Defect(s) Reported-by: Coverity Scan
** CID 1026513: Division or modulo by zero (DIVIDE_BY_ZERO)
/mnt/devel/GIT/3.x/extra/libkface/test/recognize.cpp: 237
** CID 1026512: Division or modulo by zero (DIVIDE_BY_ZERO)
/mnt/devel/GIT/3.x/extra/libkface/test/recognize.cpp: 203
________________________________________________________________________
CID 1026513: Division or modulo by zero (DIVIDE_BY_ZERO)
/mnt/devel/GIT/3.x/extra/libkface/test/recognize.cpp: 188 ( assignment)
185 QTime time;
186 time.start();
187
>>> Assigning: "totalRecognized" = "0".
188 int correct = 0, notRecognized = 0, falsePositive = 0,
totalTrained = 0, totalRecognized = 0, elapsed;
189
190 for (QMap<int, QStringList>::const_iterator it =
trainingImages.begin(); it != trainingImages.end(); ++it)
191 {
192 Identity identity = db.addIdentity(QMap<QString,
QString>());
/mnt/devel/GIT/3.x/extra/libkface/test/recognize.cpp: 237 ( divide_by_zero)
234 totalRecognized += images.size();
235 }
236 elapsed = time.elapsed();
>>> CID 1026513: Division or modulo by zero (DIVIDE_BY_ZERO)
>>> In expression "(float)elapsed / totalRecognized", division by
expression "totalRecognized" which may be zero has undefined behavior.
237 qDebug() << "Recognition of 5/10 or ORL took" << elapsed
<< "ms," << ((float)elapsed/totalRecognized) << "ms per image";
238
239 qDebug() << correct << "of 200 (" <<
(float(correct)/totalRecognized*100) << "%) were correctly recognized";
240 qDebug() << falsePositive << "of 200 (" <<
(float(falsePositive)/totalRecognized*100) << "%) were falsely assigned to
an identity";
241 qDebug() << notRecognized << "of 200 (" <<
(float(notRecognized)/totalRecognized*100) << "%) were not recognized";
________________________________________________________________________
CID 1026512: Division or modulo by zero (DIVIDE_BY_ZERO)
/mnt/devel/GIT/3.x/extra/libkface/test/recognize.cpp: 188 ( assignment)
185 QTime time;
186 time.start();
187
>>> Assigning: "totalTrained" = "0".
188 int correct = 0, notRecognized = 0, falsePositive = 0,
totalTrained = 0, totalRecognized = 0, elapsed;
189
190 for (QMap<int, QStringList>::const_iterator it =
trainingImages.begin(); it != trainingImages.end(); ++it)
191 {
192 Identity identity = db.addIdentity(QMap<QString,
QString>());
/mnt/devel/GIT/3.x/extra/libkface/test/recognize.cpp: 203 ( divide_by_zero)
200 totalTrained += images.size();
201 }
202 elapsed = time.restart();
>>> CID 1026512: Division or modulo by zero (DIVIDE_BY_ZERO)
>>> In expression "(float)elapsed / totalTrained", division by expression
"totalTrained" which may be zero has undefined behavior.
203 qDebug() << "Training 5/10 or ORL took" << elapsed <<
"ms," << ((float)elapsed/totalTrained) << "ms per image";
204
205 // reload db
206 db = RecognitionDatabase();
207 db =
RecognitionDatabase::addDatabase(QDir::currentPath());
________________________________________________________________________
To view the defects in Coverity Scan visit, http://scan.coverity.com
To unsubscribe from the email notification for new defects,
http://scan5.coverity.com/cgi-bin/unsubscribe.py
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/digikam-devel/attachments/20130531/c164aadc/attachment.html>
More information about the Digikam-devel
mailing list