New Defects reported by Coverity Scan for digiKam

scan-admin at coverity.com scan-admin at coverity.com
Tue Mar 1 21:05:56 GMT 2022


Hi,

Please find the latest report on new defect(s) introduced to digiKam found with Coverity Scan.

7 new defect(s) introduced to digiKam found with Coverity Scan.
3 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 7 of 7 defect(s)


** CID 1502823:  Integer handling issues  (OVERFLOW_BEFORE_WIDEN)
/home/gilles/Devel/8.x/core/libs/database/haar/haariface.cpp: 825 in Digikam::HaarIface::findDuplicates(const QSet<long long> &, const QSet<long long>::const_iterator &, const QSet<long long>::const_iterator &, double, double, Digikam::HaarIface::DuplicatesSearchRestrictions, Digikam::HaarProgressObserver *)()


________________________________________________________________________________________________________
*** CID 1502823:  Integer handling issues  (OVERFLOW_BEFORE_WIDEN)
/home/gilles/Devel/8.x/core/libs/database/haar/haariface.cpp: 825 in Digikam::HaarIface::findDuplicates(const QSet<long long> &, const QSet<long long>::const_iterator &, const QSet<long long>::const_iterator &, double, double, Digikam::HaarIface::DuplicatesSearchRestrictions, Digikam::HaarProgressObserver *)()
819                     qlonglong refFileSize   = 0;
820                     qlonglong reference     = *images2ScanIterator;
821     
822                     foreach (const qlonglong& refId, duplicates)
823                     {
824                         ItemInfo info(refId);
>>>     CID 1502823:  Integer handling issues  (OVERFLOW_BEFORE_WIDEN)
>>>     Potentially overflowing expression "info.dimensions().width() * info.dimensions().height()" with type "int" (32 bits, signed) is evaluated using 32-bit arithmetic, and then used in a context that expects an expression of type "quint64" (64 bits, unsigned).
825                         quint64 infoPixelSize = info.dimensions().width() *
826                                                 info.dimensions().height();
827     
828                         if (
829                             !refDateTime.isValid()                ||
830                             (info.dateTime()  <  refDateTime)     ||

** CID 1502822:  Resource leaks  (CTOR_DTOR_LEAK)
/home/gilles/Devel/8.x/core/libs/dimg/filters/imgqsort/imagequalityparser_p.h: 85 in Digikam::ImageQualityParser::Private::Private()()


________________________________________________________________________________________________________
*** CID 1502822:  Resource leaks  (CTOR_DTOR_LEAK)
/home/gilles/Devel/8.x/core/libs/dimg/filters/imgqsort/imagequalityparser_p.h: 85 in Digikam::ImageQualityParser::Private::Private()()
79         {
80             for (int c = 0 ; c < 3 ; ++c)
81             {
82                 fimg[c] = nullptr;
83             }
84     
>>>     CID 1502822:  Resource leaks  (CTOR_DTOR_LEAK)
>>>     Allocating memory by calling "new Digikam::ImageQualityCalculator".
85             calculator = new ImageQualityCalculator();
86         }
87     
88         float*                  fimg[3];
89         const uint              clusterCount;
90         const uint              size;              ///< Size of squared original image.

** CID 1502821:  Error handling issues  (CHECKED_RETURN)
/home/gilles/Devel/8.x/core/dplugins/generic/tools/mjpegstream/mjpegstreamdlg_server.cpp: 113 in DigikamGenericMjpegStreamPlugin::MjpegStreamDlg::startMjpegServer()()


________________________________________________________________________________________________________
*** CID 1502821:  Error handling issues  (CHECKED_RETURN)
/home/gilles/Devel/8.x/core/dplugins/generic/tools/mjpegstream/mjpegstreamdlg_server.cpp: 113 in DigikamGenericMjpegStreamPlugin::MjpegStreamDlg::startMjpegServer()()
107         }
108     
109         d->mngr->setSettings(d->settings);
110     
111         if (!d->mngr->startMjpegServer())
112         {
>>>     CID 1502821:  Error handling issues  (CHECKED_RETURN)
>>>     Calling "warning" without checking return value (as is done elsewhere 29 out of 36 times).
113             QMessageBox::warning(this, i18nc("@title", "Starting Media Server"),
114                                  i18nc("@info", "An error occurs while to start Media Server..."));
115         }
116         else
117         {
118             d->mngr->mjpegServerNotification(true);

** CID 1502820:  Low impact quality  (MISSING_MOVE_ASSIGNMENT)
/home/gilles/Devel/8.x/core/showfoto/thumbbar/showfotoiteminfo.h: 47 in ()


________________________________________________________________________________________________________
*** CID 1502820:  Low impact quality  (MISSING_MOVE_ASSIGNMENT)
/home/gilles/Devel/8.x/core/showfoto/thumbbar/showfotoiteminfo.h: 47 in ()
41     
42     class QDataStream;
43     
44     namespace ShowFoto
45     {
46     
>>>     CID 1502820:  Low impact quality  (MISSING_MOVE_ASSIGNMENT)
>>>     Class "ShowFoto::ShowfotoItemInfo" may benefit from adding a move assignment operator. See other events which show the copy assignment operator being applied to rvalues, where a move assignment may be faster.
47     class ShowfotoItemInfo
48     {
49     public:
50     
51         explicit ShowfotoItemInfo();
52         ~ShowfotoItemInfo();

** CID 1502819:  Integer handling issues  (OVERFLOW_BEFORE_WIDEN)
/home/gilles/Devel/8.x/core/dplugins/dimg/tiff/dimgtiffloader_load.cpp: 778 in DigikamTIFFDImgPlugin::DImgTIFFLoader::load(const QString &, Digikam::DImgLoaderObserver *)()


________________________________________________________________________________________________________
*** CID 1502819:  Integer handling issues  (OVERFLOW_BEFORE_WIDEN)
/home/gilles/Devel/8.x/core/dplugins/dimg/tiff/dimgtiffloader_load.cpp: 778 in DigikamTIFFDImgPlugin::DImgTIFFLoader::load(const QString &, Digikam::DImgLoaderObserver *)()
772                         TIFFClose(tif);
773                         loadingFailed();
774     
775                         return false;
776                     }
777     
>>>     CID 1502819:  Integer handling issues  (OVERFLOW_BEFORE_WIDEN)
>>>     Potentially overflowing expression "rows_to_read * img.width" with type "unsigned int" (32 bits, unsigned) is evaluated using 32-bit arithmetic, and then used in a context that expects an expression of type "qint64" (64 bits, signed).
778                     pixelsRead      = rows_to_read * img.width;
779     
780                     uchar* stripPtr = (uchar*)(strip.data());
781                     uchar* dataPtr  = (uchar*)(data.data() + offset);
782                     uchar* p        = nullptr;
783     

** CID 1494562:  Low impact quality  (MISSING_MOVE_ASSIGNMENT)
/usr/include/qt5/QtWidgets/qstyleoption.h: 74 in ()


________________________________________________________________________________________________________
*** CID 1494562:  Low impact quality  (MISSING_MOVE_ASSIGNMENT)
/usr/include/qt5/QtWidgets/qstyleoption.h: 74 in ()
68     
69     QT_BEGIN_NAMESPACE
70     
71     
72     class QDebug;
73     
>>>     CID 1494562:  Low impact quality  (MISSING_MOVE_ASSIGNMENT)
>>>     Class "QStyleOption" may benefit from adding a move assignment operator. See other events which show the copy assignment operator being applied to rvalues, where a move assignment may be faster.
74     class Q_WIDGETS_EXPORT QStyleOption
75     {
76     public:
77         enum OptionType {
78                           SO_Default, SO_FocusRect, SO_Button, SO_Tab, SO_MenuItem,
79                           SO_Frame, SO_ProgressBar, SO_ToolBox, SO_Header,

** CID 1394485:  Uninitialized members  (UNINIT_CTOR)
/usr/include/qt5/QtGui/qmatrix.h: 60 in QMatrix::QMatrix(Qt::Initialization)()


________________________________________________________________________________________________________
*** CID 1394485:  Uninitialized members  (UNINIT_CTOR)
/usr/include/qt5/QtGui/qmatrix.h: 60 in QMatrix::QMatrix(Qt::Initialization)()
54     class QPainterPath;
55     class QVariant;
56     
57     class Q_GUI_EXPORT QMatrix // 2D transform matrix
58     {
59     public:
>>>     CID 1394485:  Uninitialized members  (UNINIT_CTOR)
>>>     Non-static class member "_dy" is not initialized in this constructor nor in any functions that it calls.
60         inline explicit QMatrix(Qt::Initialization) {}
61         QMatrix();
62         QMatrix(qreal m11, qreal m12, qreal m21, qreal m22,
63                 qreal dx, qreal dy);
64     
65     #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)


________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50yp2OAl-2Fauo86CB28HCT0-2BnD-2F6eFMYt863B1-2B0FLvU5y-2FRWSl8rMA4vGwCkGPp0f1hg-3DktUN_IpEMwFcbl-2BY9RHaL2m6a3nuAxB4hfm4MTniX0gHjADUbjKepkNjQYizzdThkHzvnccUk-2FZwMVQCdQ8TB9pQcFLtF1WjkDwi-2BPsKmcvJ7EeqDatT1jVoFDBmUV-2BGlkG-2F60xqJxhzMc4vgd6ExjwuWIWvvSJMUbxCkck97-2Fn7pPUMjq2N9L48NIZlfJeUajH38FJyZGZswCU-2Bccc39dackZA-3D-3D



More information about the Digikam-devel mailing list