Fwd: New Defects reported by Coverity Scan for digiKam

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Fwd: New Defects reported by Coverity Scan for digiKam

Gilles Caulier-4


---------- Forwarded message ----------
From: <[hidden email]>
Date: 2013/5/31
Subject: New Defects reported by Coverity Scan for digiKam
To: [hidden email]



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


_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel