[Digikam-devel] New Defects reported by Coverity Scan for digiKam
scan-admin at coverity.com
scan-admin at coverity.com
Mon Feb 22 10:06:22 GMT 2016
Hi,
Please find the latest report on new defect(s) introduced to digiKam found with Coverity Scan.
10 new defect(s) introduced to digiKam found with Coverity Scan.
11 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 10 of 10 defect(s)
** CID 1353477: Resource leaks (VIRTUAL_DTOR)
/home/gilles/Devel/5.x/core/utilities/assistants/calendar/print/calpainter.cpp: 59 in Digikam::CalPainter::~CalPainter()()
________________________________________________________________________________________________________
*** CID 1353477: Resource leaks (VIRTUAL_DTOR)
/home/gilles/Devel/5.x/core/utilities/assistants/calendar/print/calpainter.cpp: 59 in Digikam::CalPainter::~CalPainter()()
53 : QPainter(pd)
54 {
55 orientation_ = MetaEngine::ORIENTATION_UNSPECIFIED;
56 cancelled_ = false;
57 }
58
>>> CID 1353477: Resource leaks (VIRTUAL_DTOR)
>>> Class "Digikam::CalPainter" has a destructor and a pointer to it is upcast to class "QPainter" which doesn't have a virtual destructor.
59 CalPainter::~CalPainter()
60 {
61 }
62
63 void CalPainter::cancel()
64 {
** CID 1353476: Uninitialized members (UNINIT_CTOR)
/home/gilles/Devel/5.x/core/utilities/assistants/expoblending/blendingdlg/expoblendingdlg.cpp: 93 in Digikam::ExpoBlendingDlg::Private::Private()()
________________________________________________________________________________________________________
*** CID 1353476: Uninitialized members (UNINIT_CTOR)
/home/gilles/Devel/5.x/core/utilities/assistants/expoblending/blendingdlg/expoblendingdlg.cpp: 93 in Digikam::ExpoBlendingDlg::Private::Private()()
87 enfuseStack(0),
88 mngr(0),
89 firstImageDisplayed(false),
90 previewButton(0),
91 propagateReject(true)
92 {
>>> CID 1353476: Uninitialized members (UNINIT_CTOR)
>>> Non-static class member "startButton" is not initialized in this constructor nor in any functions that it calls.
93 }
94
95 QString inputFileName;
96 QString output;
97
98 QLineEdit* templateFileName;
** CID 1353475: Control flow issues (MISSING_BREAK)
/home/gilles/Devel/5.x/core/utilities/assistants/panorama/ptotype/ptotype.cpp: 102 in Digikam::PTOType::createFile(const QString &)()
________________________________________________________________________________________________________
*** CID 1353475: Control flow issues (MISSING_BREAK)
/home/gilles/Devel/5.x/core/utilities/assistants/panorama/ptotype/ptotype.cpp: 102 in Digikam::PTOType::createFile(const QString &)()
96 break;
97 case Project::FileFormat::TIFF:
98 out << "TIFF c:" << project.fileFormat.compressionMethod;
99 break;
100 case Project::FileFormat::TIFF_m:
101 out << "TIFF_m";
>>> CID 1353475: Control flow issues (MISSING_BREAK)
>>> The above case falls through to this one.
102 case Project::FileFormat::TIFF_multilayer:
103 if (project.fileFormat.fileType == Project::FileFormat::TIFF_multilayer)
104 out << "TIFF_multilayer";
105 out << " c:";
106 switch (project.fileFormat.compressionMethod)
107 {
** CID 1353474: Incorrect expression (IDENTICAL_BRANCHES)
/core/utilities/assistants/common/moc_dimageslist.cpp: 251 in Digikam::CtrlButton::qt_metacall(QMetaObject::Call, int, void **)()
________________________________________________________________________________________________________
*** CID 1353474: Incorrect expression (IDENTICAL_BRANCHES)
/core/utilities/assistants/common/moc_dimageslist.cpp: 251 in Digikam::CtrlButton::qt_metacall(QMetaObject::Call, int, void **)()
245 return QPushButton::qt_metacast(_clname);
246 }
247
248 int Digikam::CtrlButton::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
249 {
250 _id = QPushButton::qt_metacall(_c, _id, _a);
>>> CID 1353474: Incorrect expression (IDENTICAL_BRANCHES)
>>> The same code is executed when the condition "_id < 0" is true or false, because the code in the if-then branch and after the if statement is identical. Should the if statement be removed?
251 if (_id < 0)
252 return _id;
253 return _id;
254 }
255 struct qt_meta_stringdata_Digikam__DImagesList_t {
256 QByteArrayData data[32];
** CID 1353473: Incorrect expression (IDENTICAL_BRANCHES)
/core/utilities/assistants/expoblending/moc_enfusesettings.cpp: 85 in Digikam::EnfuseSettingsWidget::qt_metacall(QMetaObject::Call, int, void **)()
________________________________________________________________________________________________________
*** CID 1353473: Incorrect expression (IDENTICAL_BRANCHES)
/core/utilities/assistants/expoblending/moc_enfusesettings.cpp: 85 in Digikam::EnfuseSettingsWidget::qt_metacall(QMetaObject::Call, int, void **)()
79 return QWidget::qt_metacast(_clname);
80 }
81
82 int Digikam::EnfuseSettingsWidget::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
83 {
84 _id = QWidget::qt_metacall(_c, _id, _a);
>>> CID 1353473: Incorrect expression (IDENTICAL_BRANCHES)
>>> The same code is executed when the condition "_id < 0" is true or false, because the code in the if-then branch and after the if statement is identical. Should the if statement be removed?
85 if (_id < 0)
86 return _id;
87 return _id;
88 }
** CID 1353472: Null pointer dereferences (FORWARD_NULL)
/home/gilles/Devel/5.x/core/utilities/assistants/common/dimageslist.cpp: 916 in Digikam::DImagesList::slotMoveUpItems()()
________________________________________________________________________________________________________
*** CID 1353472: Null pointer dereferences (FORWARD_NULL)
/home/gilles/Devel/5.x/core/utilities/assistants/common/dimageslist.cpp: 916 in Digikam::DImagesList::slotMoveUpItems()()
910 return;
911 }
912
913 QTreeWidgetItem* const temp = listView()->takeTopLevelItem(aboveIndex.row());
914 listView()->insertTopLevelItem(curIndex.row(), temp);
915 // this is a quick fix. We loose the extra tags in flickr upload, but at list we don't get a crash
>>> CID 1353472: Null pointer dereferences (FORWARD_NULL)
>>> Passing null pointer "dynamic_cast <Digikam::DImagesListViewItem *>(temp)" to "updateItemWidgets", which dereferences it. (The dereference happens because this is a virtual function call.)
916 dynamic_cast<Digikam::DImagesListViewItem*>(temp)->updateItemWidgets();
917
918 emit signalImageListChanged();
919 emit signalMoveUpItem();
920 }
921
** CID 1353471: Error handling issues (CHECKED_RETURN)
/home/gilles/Devel/5.x/extra/kipi-plugins/printimages/tools/tphoto.cpp: 176 in KIPIPrintImagesPlugin::TPhoto::metaIface()()
________________________________________________________________________________________________________
*** CID 1353471: Error handling issues (CHECKED_RETURN)
/home/gilles/Devel/5.x/extra/kipi-plugins/printimages/tools/tphoto.cpp: 176 in KIPIPrintImagesPlugin::TPhoto::metaIface()()
170 if (!m_iface)
171 return 0;
172
173 if (!m_meta && !filename.url().isEmpty())
174 {
175 m_meta = m_iface->createMetadataProcessor();
>>> CID 1353471: Error handling issues (CHECKED_RETURN)
>>> Calling "load" without checking return value (as is done elsewhere 24 out of 26 times).
176 m_meta->load(filename);
177 }
178
179 return m_meta;
180 }
181
** CID 1353470: Error handling issues (CHECKED_RETURN)
/home/gilles/Devel/5.x/extra/kipi-plugins/mediawiki/wmwindow.cpp: 304 in KIPIWikiMediaPlugin::WMWindow::prepareImageForUpload(const QString &)()
________________________________________________________________________________________________________
*** CID 1353470: Error handling issues (CHECKED_RETURN)
/home/gilles/Devel/5.x/extra/kipi-plugins/mediawiki/wmwindow.cpp: 304 in KIPIWikiMediaPlugin::WMWindow::prepareImageForUpload(const QString &)()
298 // save empty metadata to erase them
299 meta->save(QUrl::fromLocalFile(d->tmpPath), true);
300 }
301 else
302 {
303 // copy meta data from initial to temporary image
>>> CID 1353470: Error handling issues (CHECKED_RETURN)
>>> Calling "load" without checking return value (as is done elsewhere 24 out of 26 times).
304 meta->load(QUrl::fromLocalFile(imgPath));
305
306 if (d->widget->resize())
307 {
308 meta->setImageDimensions(image.size());
309 }
** CID 1353469: Error handling issues (CHECKED_RETURN)
/home/gilles/Devel/5.x/core/utilities/assistants/common/dimageslist.cpp: 1036 in Digikam::DImagesList::slotSaveItems()()
________________________________________________________________________________________________________
*** CID 1353469: Error handling issues (CHECKED_RETURN)
/home/gilles/Devel/5.x/core/utilities/assistants/common/dimageslist.cpp: 1036 in Digikam::DImagesList::slotSaveItems()()
1030 {
1031 qCDebug(DIGIKAM_GENERAL_LOG) << "empty url ";
1032 return;
1033 }
1034
1035 QFile file(saveLevelsFile.path() /*.prettyUrl().toAscii()*/);
>>> CID 1353469: Error handling issues (CHECKED_RETURN)
>>> Calling "open" without checking return value (as is done elsewhere 50 out of 52 times).
1036 file.open(QIODevice::WriteOnly);
1037 // file.open(stdout, QIODevice::WriteOnly);
1038
1039 QXmlStreamWriter xmlWriter;
1040 xmlWriter.setDevice(&file);
1041
** CID 1353468: Error handling issues (CHECKED_RETURN)
/home/gilles/Devel/5.x/core/utilities/assistants/common/dimageslist.cpp: 975 in Digikam::DImagesList::slotLoadItems()()
________________________________________________________________________________________________________
*** CID 1353468: Error handling issues (CHECKED_RETURN)
/home/gilles/Devel/5.x/core/utilities/assistants/common/dimageslist.cpp: 975 in Digikam::DImagesList::slotLoadItems()()
969 return;
970 }
971
972 QFile file(loadLevelsFile.path());
973
974 qCDebug(DIGIKAM_GENERAL_LOG) << "file path " << loadLevelsFile.path();
>>> CID 1353468: Error handling issues (CHECKED_RETURN)
>>> Calling "open" without checking return value (as is done elsewhere 50 out of 52 times).
975 file.open(QIODevice::ReadOnly);
976 QXmlStreamReader xmlReader;
977 xmlReader.setDevice(&file);
978
979 while (!xmlReader.atEnd())
980 {
________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://scan.coverity.com/projects/digikam?tab=overview
To manage Coverity Scan email notifications for "digikam-devel at kde.org", click https://scan.coverity.com/subscriptions/edit?email=digikam-devel%40kde.org&token=621bfe7450f4a870432a2a9c106aa3a8
More information about the Digikam-devel
mailing list