New Defects reported by Coverity Scan for krita
scan-admin at coverity.com
scan-admin at coverity.com
Sun Mar 13 00:14:32 GMT 2022
Hi,
Please find the latest report on new defect(s) introduced to krita found with Coverity Scan.
29 new defect(s) introduced to krita found with Coverity Scan.
102 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 20 of 29 defect(s)
** CID 350668: Integer handling issues (DIVIDE_BY_ZERO)
________________________________________________________________________________________________________
*** CID 350668: Integer handling issues (DIVIDE_BY_ZERO)
/home/tymon/kritadev/krita/libs/pigment/resources/KoColorSet.cpp: 1622 in KoColorSet::Private::loadAcb()()
1616 QString postfix = metadata.at(2);
1617 QString description = metadata.at(3);
1618 colorSet->setComment(description);
1619
1620 quint16 numColors = readShort(&buf);
1621 quint16 numColumns = readShort(&buf);
>>> CID 350668: Integer handling issues (DIVIDE_BY_ZERO)
>>> In function call "setColumnCount", division by expression "numColumns" which may be zero has undefined behavior.
1622 colorSet->setColumnCount(numColumns);
1623 quint16 numKeyColorPage = readShort(&buf);
1624 Q_UNUSED(numKeyColorPage);
1625 quint16 colorType = readShort(&buf);
1626
1627 const KoColorSpace *cs = KoColorSpaceRegistry::instance()->rgb8();
** CID 350667: Null pointer dereferences (FORWARD_NULL)
________________________________________________________________________________________________________
*** CID 350667: Null pointer dereferences (FORWARD_NULL)
/home/tymon/kritadev/krita/plugins/tools/selectiontools/kis_tool_select_path.cc: 186 in __KisToolSelectPathLocalTool::beginShape()()
180 helper.addSelectionShape(pathShape, m_selectionTool->selectionAction());
181 }
182 }
183
184 void __KisToolSelectPathLocalTool::beginShape()
185 {
>>> CID 350667: Null pointer dereferences (FORWARD_NULL)
>>> Passing null pointer "dynamic_cast <KisToolSelectPath *>(this->m_selectionTool)" to "beginSelectInteraction", which dereferences it.
186 dynamic_cast<KisToolSelectPath*>(m_selectionTool)->beginSelectInteraction();
187 }
188
189 void __KisToolSelectPathLocalTool::endShape()
190 {
191 dynamic_cast<KisToolSelectPath*>(m_selectionTool)->endSelectInteraction();
** CID 350666: Incorrect expression (USELESS_CALL)
________________________________________________________________________________________________________
*** CID 350666: Incorrect expression (USELESS_CALL)
/usr/include/x86_64-linux-gnu/qt5/QtCore/qvector.h: 823 in QVector<KisOptionCollectionWidgetWrapper *>::erase(QTypedArrayData<KisOptionCollectionWidgetWrapper *>::iterator, QTypedArrayData<KisOptionCollectionWidgetWrapper *>::iterator)()
817 aend = abegin + itemsToErase;
818 if (!QTypeInfoQuery<T>::isRelocatable) {
819 iterator moveBegin = abegin + itemsToErase;
820 iterator moveEnd = d->end();
821 while (moveBegin != moveEnd) {
822 if (QTypeInfo<T>::isComplex)
>>> CID 350666: Incorrect expression (USELESS_CALL)
>>> Calling "abegin.operator KisOptionCollectionWidgetWrapper **()" is only useful for its return value, which is ignored.
823 static_cast<T *>(abegin)->~T();
824 new (abegin++) T(*moveBegin++);
825 }
826 if (abegin < d->end()) {
827 // destroy rest of instances
828 destruct(abegin, d->end());
** CID 350665: Null pointer dereferences (FORWARD_NULL)
________________________________________________________________________________________________________
*** CID 350665: Null pointer dereferences (FORWARD_NULL)
/home/tymon/kritadev/krita/plugins/tools/selectiontools/kis_tool_select_path.cc: 191 in __KisToolSelectPathLocalTool::endShape()()
185 {
186 dynamic_cast<KisToolSelectPath*>(m_selectionTool)->beginSelectInteraction();
187 }
188
189 void __KisToolSelectPathLocalTool::endShape()
190 {
>>> CID 350665: Null pointer dereferences (FORWARD_NULL)
>>> Passing null pointer "dynamic_cast <KisToolSelectPath *>(this->m_selectionTool)" to "endSelectInteraction", which dereferences it.
191 dynamic_cast<KisToolSelectPath*>(m_selectionTool)->endSelectInteraction();
192 }
193
194 void KisToolSelectPath::resetCursorStyle()
195 {
196 if (selectionAction() == SELECTION_ADD) {
** CID 350664: Null pointer dereferences (FORWARD_NULL)
/home/tymon/kritadev/krita/libs/widgetutils/KisOptionCollectionWidget.cpp: 205 in KisOptionCollectionWidget::Private::insertWidget(int, const QString &, QWidget *)()
________________________________________________________________________________________________________
*** CID 350664: Null pointer dereferences (FORWARD_NULL)
/home/tymon/kritadev/krita/libs/widgetutils/KisOptionCollectionWidget.cpp: 205 in KisOptionCollectionWidget::Private::insertWidget(int, const QString &, QWidget *)()
199 widgetWrapper->setOrientation(orientation);
200 widgetWrapper->setWidgetMargin(widgetsMargin);
201 widgetWrappers.insert(index, widgetWrapper);
202
203 QBoxLayout *layoutMain = dynamic_cast<QBoxLayout*>(q->layout());
204 int indexLayout;
>>> CID 350664: Null pointer dereferences (FORWARD_NULL)
>>> Passing null pointer "layoutMain" to "count", which dereferences it. (The dereference happens because this is a virtual function call.)
205 for (indexLayout = 0; indexLayout < layoutMain->count(); ++indexLayout) {
206 const QWidget *prevWidget = layoutMain->itemAt(indexLayout)->widget();
207 const int prevIndex = q->widgetIndexFromId(prevWidget->property("id").toString());
208 if (prevIndex >= index) {
209 break;
210 }
** CID 350663: Null pointer dereferences (FORWARD_NULL)
/home/tymon/kritadev/krita/libs/widgetutils/KisOptionCollectionWidget.cpp: 75 in KisOptionCollectionWidgetWrapper::setOrientation(Qt::Orientation)()
________________________________________________________________________________________________________
*** CID 350663: Null pointer dereferences (FORWARD_NULL)
/home/tymon/kritadev/krita/libs/widgetutils/KisOptionCollectionWidget.cpp: 75 in KisOptionCollectionWidgetWrapper::setOrientation(Qt::Orientation)()
69 }
70 }
71
72 void setOrientation(Qt::Orientation orientation)
73 {
74 QBoxLayout *layoutMain = dynamic_cast<QBoxLayout*>(layout());
>>> CID 350663: Null pointer dereferences (FORWARD_NULL)
>>> Passing null pointer "layoutMain" to "itemAt", which dereferences it. (The dereference happens because this is a virtual function call.)
75 QBoxLayout *layoutWidget = dynamic_cast<QBoxLayout*>(layoutMain->itemAt(0)->layout());
76 if (orientation == Qt::Vertical) {
77 if (layoutMain->direction() == QBoxLayout::TopToBottom) {
78 return;
79 }
80 layoutWidget->setContentsMargins(m_margin, 0, m_margin, 0);
** CID 350662: Null pointer dereferences (FORWARD_NULL)
/home/tymon/kritadev/krita/libs/widgetutils/KisOptionCollectionWidget.cpp: 176 in KisOptionCollectionWidgetWithHeader::Private::adjustWidgetCollection()()
________________________________________________________________________________________________________
*** CID 350662: Null pointer dereferences (FORWARD_NULL)
/home/tymon/kritadev/krita/libs/widgetutils/KisOptionCollectionWidget.cpp: 176 in KisOptionCollectionWidgetWithHeader::Private::adjustWidgetCollection()()
170 layoutMain->insertLayout(1, layoutWidgets, 1);
171 widgetCollection->setVisible(true);
172 } else {
173 if (widgetCollection->numberOfVisibleWidgets() != 0) {
174 return;
175 }
>>> CID 350662: Null pointer dereferences (FORWARD_NULL)
>>> Passing null pointer "layoutMain" to "takeAt", which dereferences it. (The dereference happens because this is a virtual function call.)
176 layoutMain->takeAt(1);
177 widgetCollection->setVisible(false);
178 }
179 }
180
181 };
** CID 350661: Null pointer dereferences (FORWARD_NULL)
/home/tymon/kritadev/krita/libs/widgetutils/KisOptionCollectionWidget.cpp: 59 in KisOptionCollectionWidgetWrapper::setSeparatorVisible(bool)()
________________________________________________________________________________________________________
*** CID 350661: Null pointer dereferences (FORWARD_NULL)
/home/tymon/kritadev/krita/libs/widgetutils/KisOptionCollectionWidget.cpp: 59 in KisOptionCollectionWidgetWrapper::setSeparatorVisible(bool)()
53 return m_widget;
54 }
55
56 void setSeparatorVisible(bool visible)
57 {
58 QBoxLayout *layoutMain = dynamic_cast<QBoxLayout*>(layout());
>>> CID 350661: Null pointer dereferences (FORWARD_NULL)
>>> Passing null pointer "layoutMain" to "count", which dereferences it. (The dereference happens because this is a virtual function call.)
59 const bool isVisible = layoutMain->count() > 1;
60 if (isVisible == visible) {
61 return;
62 }
63 if (isVisible) {
64 layoutMain->takeAt(1);
** CID 350660: (RESOURCE_LEAK)
/home/tymon/kritadev/krita/libs/psd/psd_additional_layer_info_block.h: 442 in psd_layer_gradient_fill::getASLXML()()
/home/tymon/kritadev/krita/libs/psd/psd_additional_layer_info_block.h: 437 in psd_layer_gradient_fill::getASLXML()()
________________________________________________________________________________________________________
*** CID 350660: (RESOURCE_LEAK)
/home/tymon/kritadev/krita/libs/psd/psd_additional_layer_info_block.h: 442 in psd_layer_gradient_fill::getASLXML()()
436 }
437 } else if (gradientType == "segment") {
438 const KoSegmentGradient *grad = new KoSegmentGradient(KoSegmentGradient::fromXML(gradientElement));
439 if (grad && grad->valid()) {
440 w.writeSegmentGradient("Grad", grad);
441 }
>>> CID 350660: (RESOURCE_LEAK)
>>> Variable "grad" going out of scope leaks the storage it points to.
442 }
443 }
444 }
445 w.writeBoolean("Dthr", dithered);
446 w.writeBoolean("Rvrs", reverse);
447 w.writeUnitFloat("Angl", "#Ang", angle);
/home/tymon/kritadev/krita/libs/psd/psd_additional_layer_info_block.h: 437 in psd_layer_gradient_fill::getASLXML()()
431 const QString gradientType = gradientElement.attribute("type");
432 if (gradientType == "stop") {
433 const KoStopGradient *grad = new KoStopGradient(KoStopGradient::fromXML(gradientElement));
434 if (grad && grad->valid()) {
435 w.writeStopGradient("Grad", grad);
436 }
>>> CID 350660: (RESOURCE_LEAK)
>>> Variable "grad" going out of scope leaks the storage it points to.
437 } else if (gradientType == "segment") {
438 const KoSegmentGradient *grad = new KoSegmentGradient(KoSegmentGradient::fromXML(gradientElement));
439 if (grad && grad->valid()) {
440 w.writeSegmentGradient("Grad", grad);
441 }
442 }
** CID 350659: Error handling issues (CHECKED_RETURN)
/home/tymon/kritadev/krita/libs/libqml/DocumentManager.cpp: 191 in DocumentManager::delayedOpenDocument()()
________________________________________________________________________________________________________
*** CID 350659: Error handling issues (CHECKED_RETURN)
/home/tymon/kritadev/krita/libs/libqml/DocumentManager.cpp: 191 in DocumentManager::delayedOpenDocument()()
185 connect(d->document, SIGNAL(completed()), this, SLOT(onLoadCompleted()));
186 connect(d->document, SIGNAL(canceled(QString)), this, SLOT(onLoadCanceled(QString)));
187
188 // TODO: still needed?
189 d->document->setModified(false);
190 if (d->importingDocument)
>>> CID 350659: Error handling issues (CHECKED_RETURN)
>>> Calling "importDocument" without checking return value (as is done elsewhere 4 out of 5 times).
191 d->document->importDocument(d->openDocumentFilename);
192 else
193 d->document->openPath(d->openDocumentFilename);
194 // TODO: handle fail of open/import
195 d->recentFileManager->addRecent(d->openDocumentFilename);
196
** CID 350658: Null pointer dereferences (FORWARD_NULL)
/home/tymon/kritadev/krita/libs/widgetutils/KisOptionCollectionWidget.cpp: 103 in KisOptionCollectionWidgetWrapper::setWidgetMargin(int)()
________________________________________________________________________________________________________
*** CID 350658: Null pointer dereferences (FORWARD_NULL)
/home/tymon/kritadev/krita/libs/widgetutils/KisOptionCollectionWidget.cpp: 103 in KisOptionCollectionWidgetWrapper::setWidgetMargin(int)()
97 if (m_margin == margin) {
98 return;
99 }
100 m_margin = margin;
101 QBoxLayout *layoutMain = dynamic_cast<QBoxLayout*>(layout());
102 if (layoutMain->direction() == QBoxLayout::TopToBottom) {
>>> CID 350658: Null pointer dereferences (FORWARD_NULL)
>>> Passing null pointer "layoutMain" to "itemAt", which dereferences it. (The dereference happens because this is a virtual function call.)
103 QBoxLayout *layoutWidget = dynamic_cast<QBoxLayout*>(layoutMain->itemAt(0)->layout());
104 layoutWidget->setContentsMargins(margin, 0, margin, 0);
105 }
106 }
107
108 private:
** CID 350657: (CHECKED_RETURN)
/home/tymon/kritadev/krita/libs/psdutils/asl/kis_asl_reader.cpp: 513 in Private::readPattern<(psd_byte_order)1>(QIODevice &, QDomElement *, QDomDocument *)()
/home/tymon/kritadev/krita/libs/psdutils/asl/kis_asl_reader.cpp: 511 in Private::readPattern<(psd_byte_order)0>(QIODevice &, QDomElement *, QDomDocument *)()
/home/tymon/kritadev/krita/libs/psdutils/asl/kis_asl_reader.cpp: 511 in Private::readPattern<(psd_byte_order)1>(QIODevice &, QDomElement *, QDomDocument *)()
/home/tymon/kritadev/krita/libs/psdutils/asl/kis_asl_reader.cpp: 513 in Private::readPattern<(psd_byte_order)0>(QIODevice &, QDomElement *, QDomDocument *)()
/home/tymon/kritadev/krita/libs/psdutils/asl/kis_asl_reader.cpp: 512 in Private::readPattern<(psd_byte_order)0>(QIODevice &, QDomElement *, QDomDocument *)()
/home/tymon/kritadev/krita/libs/psdutils/asl/kis_asl_reader.cpp: 512 in Private::readPattern<(psd_byte_order)1>(QIODevice &, QDomElement *, QDomDocument *)()
________________________________________________________________________________________________________
*** CID 350657: (CHECKED_RETURN)
/home/tymon/kritadev/krita/libs/psdutils/asl/kis_asl_reader.cpp: 513 in Private::readPattern<(psd_byte_order)1>(QIODevice &, QDomElement *, QDomDocument *)()
507
508 if (mode == Indexed) {
509 for(auto i = 0; i < 256; i++) {
510 quint8 r, g, b;
511 psdread<byteOrder>(device, r);
512 psdread<byteOrder>(device, g);
>>> CID 350657: (CHECKED_RETURN)
>>> Calling "psdread" without checking return value (as is done elsewhere 15 out of 18 times).
513 psdread<byteOrder>(device, b);
514 palette[i] = qRgb(r, g, b);
515 }
516
517 dbgFile << "Palette: " << palette << "(" << device.pos() << ")";
518
/home/tymon/kritadev/krita/libs/psdutils/asl/kis_asl_reader.cpp: 511 in Private::readPattern<(psd_byte_order)0>(QIODevice &, QDomElement *, QDomDocument *)()
505
506 palette.resize(256);
507
508 if (mode == Indexed) {
509 for(auto i = 0; i < 256; i++) {
510 quint8 r, g, b;
>>> CID 350657: (CHECKED_RETURN)
>>> Calling "psdread" without checking return value (as is done elsewhere 16 out of 19 times).
511 psdread<byteOrder>(device, r);
512 psdread<byteOrder>(device, g);
513 psdread<byteOrder>(device, b);
514 palette[i] = qRgb(r, g, b);
515 }
516
/home/tymon/kritadev/krita/libs/psdutils/asl/kis_asl_reader.cpp: 511 in Private::readPattern<(psd_byte_order)1>(QIODevice &, QDomElement *, QDomDocument *)()
505
506 palette.resize(256);
507
508 if (mode == Indexed) {
509 for(auto i = 0; i < 256; i++) {
510 quint8 r, g, b;
>>> CID 350657: (CHECKED_RETURN)
>>> Calling "psdread" without checking return value (as is done elsewhere 15 out of 18 times).
511 psdread<byteOrder>(device, r);
512 psdread<byteOrder>(device, g);
513 psdread<byteOrder>(device, b);
514 palette[i] = qRgb(r, g, b);
515 }
516
/home/tymon/kritadev/krita/libs/psdutils/asl/kis_asl_reader.cpp: 513 in Private::readPattern<(psd_byte_order)0>(QIODevice &, QDomElement *, QDomDocument *)()
507
508 if (mode == Indexed) {
509 for(auto i = 0; i < 256; i++) {
510 quint8 r, g, b;
511 psdread<byteOrder>(device, r);
512 psdread<byteOrder>(device, g);
>>> CID 350657: (CHECKED_RETURN)
>>> Calling "psdread" without checking return value (as is done elsewhere 16 out of 19 times).
513 psdread<byteOrder>(device, b);
514 palette[i] = qRgb(r, g, b);
515 }
516
517 dbgFile << "Palette: " << palette << "(" << device.pos() << ")";
518
/home/tymon/kritadev/krita/libs/psdutils/asl/kis_asl_reader.cpp: 512 in Private::readPattern<(psd_byte_order)0>(QIODevice &, QDomElement *, QDomDocument *)()
506 palette.resize(256);
507
508 if (mode == Indexed) {
509 for(auto i = 0; i < 256; i++) {
510 quint8 r, g, b;
511 psdread<byteOrder>(device, r);
>>> CID 350657: (CHECKED_RETURN)
>>> Calling "psdread" without checking return value (as is done elsewhere 16 out of 19 times).
512 psdread<byteOrder>(device, g);
513 psdread<byteOrder>(device, b);
514 palette[i] = qRgb(r, g, b);
515 }
516
517 dbgFile << "Palette: " << palette << "(" << device.pos() << ")";
/home/tymon/kritadev/krita/libs/psdutils/asl/kis_asl_reader.cpp: 512 in Private::readPattern<(psd_byte_order)1>(QIODevice &, QDomElement *, QDomDocument *)()
506 palette.resize(256);
507
508 if (mode == Indexed) {
509 for(auto i = 0; i < 256; i++) {
510 quint8 r, g, b;
511 psdread<byteOrder>(device, r);
>>> CID 350657: (CHECKED_RETURN)
>>> Calling "psdread" without checking return value (as is done elsewhere 15 out of 18 times).
512 psdread<byteOrder>(device, g);
513 psdread<byteOrder>(device, b);
514 palette[i] = qRgb(r, g, b);
515 }
516
517 dbgFile << "Palette: " << palette << "(" << device.pos() << ")";
** CID 350656: Uninitialized variables (UNINIT)
________________________________________________________________________________________________________
*** CID 350656: Uninitialized variables (UNINIT)
/home/tymon/kritadev/krita/plugins/impex/psd/psd_loader.cpp: 325 in PSDLoader::decode(QIODevice &)()
319 catcher.subscribeBoolean("/null/Algn", std::bind(&psd_layer_pattern_fill::setAlignWithLayer, &fill, _1));
320 catcher.subscribePoint("/null/phase", std::bind(&psd_layer_pattern_fill::setOffset, &fill, _1));
321 catcher.subscribePatternRef("/null/Ptrn", std::bind(&psd_layer_pattern_fill::setPatternRef, &fill, _1, _2));
322
323 KisAslXmlParser parser;
324 parser.parseXML(layerRecord->infoBlocks.fillConfig, catcher);
>>> CID 350656: Uninitialized variables (UNINIT)
>>> Using uninitialized value "fill.scale" when calling "getFillLayerConfig".
325 fillConfig = fill.getFillLayerConfig();
326
327 } else {
328 cfg = KisGeneratorRegistry::instance()->value("color")->defaultConfiguration(KisGlobalResourcesInterface::instance());
329
330 psd_layer_solid_color fill;
** CID 350655: Uninitialized variables (UNINIT)
/home/tymon/kritadev/krita/libs/libqml/plugins/kritasketchplugin/Constants.cpp: 17 in Constants::Constants(QObject *)()
________________________________________________________________________________________________________
*** CID 350655: Uninitialized variables (UNINIT)
/home/tymon/kritadev/krita/libs/libqml/plugins/kritasketchplugin/Constants.cpp: 17 in Constants::Constants(QObject *)()
11
12 Constants::Constants(QObject* parent)
13 : QObject(parent)
14 {
15 // m_gridWidth = qApp->activeWindow()->width() / gridColumns();
16 // m_gridHeight = qApp->activeWindow()->height() / gridHeight();
>>> CID 350655: Uninitialized variables (UNINIT)
>>> Using uninitialized value "this->m_gridHeight".
17 m_toolbarButtonSize = m_gridHeight;
18 }
19
20 int Constants::animationDuration() const
21 {
22 return 150;
** CID 350654: Null pointer dereferences (REVERSE_INULL)
/home/tymon/kritadev/krita/libs/libqml/plugins/kritasketchplugin/models/RecentImageImageProvider.cpp: 45 in RecentImageImageProvider::requestImage(const QString &, QSize *, const QSize &)()
________________________________________________________________________________________________________
*** CID 350654: Null pointer dereferences (REVERSE_INULL)
/home/tymon/kritadev/krita/libs/libqml/plugins/kritasketchplugin/models/RecentImageImageProvider.cpp: 45 in RecentImageImageProvider::requestImage(const QString &, QSize *, const QSize &)()
39 QString thumbnailPath = QLatin1String("Thumbnails/thumbnail.png");
40 QString previewPath = QLatin1String("preview.png");
41 bool thumbnailExists = store->hasFile(thumbnailPath);
42 bool previewExists = store->hasFile(previewPath);
43 QString pathToUse = thumbnailExists ? thumbnailPath : (previewExists ? previewPath : "");
44
>>> CID 350654: Null pointer dereferences (REVERSE_INULL)
>>> Null-checking "store" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
45 if (store && !pathToUse.isEmpty() && store->open(pathToUse)) {
46 // Hooray! No long delay for the user...
47 const QByteArray thumbnailData = store->read(store->size());
48
49 if (thumbnail.loadFromData(thumbnailData) &&
50 (thumbnail.width() >= width || thumbnail.height() >= height)) {
** CID 350653: (FORWARD_NULL)
/home/tymon/kritadev/krita/libs/widgetutils/KisOptionCollectionWidget.cpp: 388 in KisOptionCollectionWidget::setWidgetVisible(int, bool)()
/home/tymon/kritadev/krita/libs/widgetutils/KisOptionCollectionWidget.cpp: 374 in KisOptionCollectionWidget::setWidgetVisible(int, bool)()
________________________________________________________________________________________________________
*** CID 350653: (FORWARD_NULL)
/home/tymon/kritadev/krita/libs/widgetutils/KisOptionCollectionWidget.cpp: 388 in KisOptionCollectionWidget::setWidgetVisible(int, bool)()
382 break;
383 }
384 }
385 layoutMain->insertWidget(indexLayout, widgetWrapper);
386 widgetWrapper->setVisible(true);
387 } else {
>>> CID 350653: (FORWARD_NULL)
>>> Passing null pointer "layoutMain" to "indexOf", which dereferences it. (The dereference happens because this is a virtual function call.)
388 if (layoutMain->indexOf(widgetWrapper) == -1) {
389 return;
390 }
391 layoutMain->takeAt(layoutMain->indexOf(widgetWrapper));
392 widgetWrapper->setVisible(false);
393 }
/home/tymon/kritadev/krita/libs/widgetutils/KisOptionCollectionWidget.cpp: 374 in KisOptionCollectionWidget::setWidgetVisible(int, bool)()
368 {
369 KisOptionCollectionWidgetWrapper *widgetWrapper = m_d->widgetWrappers[index];
370
371 QBoxLayout *layoutMain = dynamic_cast<QBoxLayout*>(layout());
372
373 if (visible) {
>>> CID 350653: (FORWARD_NULL)
>>> Passing null pointer "layoutMain" to "indexOf", which dereferences it. (The dereference happens because this is a virtual function call.)
374 if (layoutMain->indexOf(widgetWrapper) != -1) {
375 return;
376 }
377 int indexLayout;
378 for (indexLayout = 0; indexLayout < layoutMain->count(); ++indexLayout) {
379 const QWidget *prevWidget = layoutMain->itemAt(indexLayout)->widget();
** CID 346184: Uninitialized variables (USE_AFTER_MOVE)
/usr/include/c++/9/bits/hashtable.h: 455 in std::_Hashtable<KoShape *, KoShape *, std::allocator<KoShape *>, std::__detail::_Identity, std::equal_to<KoShape *>, std::hash<KoShape *>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<(bool)0, (bool)1, (bool)1>>::_Hashtable(std::_Hashtable<KoShape *, KoShape *, std::allocator<KoShape *>, std::__detail::_Identity, std::equal_to<KoShape *>, std::hash<KoShape *>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<(bool)0, (bool)1, (bool)1>>&&)()
________________________________________________________________________________________________________
*** CID 346184: Uninitialized variables (USE_AFTER_MOVE)
/usr/include/c++/9/bits/hashtable.h: 455 in std::_Hashtable<KoShape *, KoShape *, std::allocator<KoShape *>, std::__detail::_Identity, std::equal_to<KoShape *>, std::hash<KoShape *>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<(bool)0, (bool)1, (bool)1>>::_Hashtable(std::_Hashtable<KoShape *, KoShape *, std::allocator<KoShape *>, std::__detail::_Identity, std::equal_to<KoShape *>, std::hash<KoShape *>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<(bool)0, (bool)1, (bool)1>>&&)()
449 const allocator_type&);
450
451 _Hashtable(const _Hashtable&);
452
453 _Hashtable(_Hashtable&& __ht)
454 noexcept(_S_nothrow_move())
>>> CID 346184: Uninitialized variables (USE_AFTER_MOVE)
>>> "__ht->_M_node_allocator()" is used after it has been already moved.
455 : _Hashtable(std::move(__ht), std::move(__ht._M_node_allocator()),
456 true_type{})
457 { }
458
459 _Hashtable(const _Hashtable&, const allocator_type&);
460
** CID 311013: Error handling issues (UNCAUGHT_EXCEPT)
/home/tymon/kritadev/krita/plugins/impex/jp2/tests/KisJP2Test.cpp: 42 in main()
________________________________________________________________________________________________________
*** CID 311013: Error handling issues (UNCAUGHT_EXCEPT)
/home/tymon/kritadev/krita/plugins/impex/jp2/tests/KisJP2Test.cpp: 42 in main()
36 {
37 TestUtil::testImportIncorrectFormat(QString(FILES_DATA_DIR), JP2Mimetype);
38 }
39
40
41
>>> CID 311013: Error handling issues (UNCAUGHT_EXCEPT)
>>> In function "main(int, char **)" an exception of type "KisAssertException" is thrown and never caught.
** CID 304986: Null pointer dereferences (FORWARD_NULL)
/home/tymon/kritadev/krita/libs/libqml/plugins/kritasketchplugin/models/FiltersCategoryModel.cpp: 219 in FiltersCategoryModel::filterConfigurationChanged(int, FiltersModel *)()
________________________________________________________________________________________________________
*** CID 304986: Null pointer dereferences (FORWARD_NULL)
/home/tymon/kritadev/krita/libs/libqml/plugins/kritasketchplugin/models/FiltersCategoryModel.cpp: 219 in FiltersCategoryModel::filterConfigurationChanged(int, FiltersModel *)()
213 }
214 KisFilterConfigurationSP config;
215 KisFilter* filter = model->filter(index);
216 if (filter->showConfigurationWidget() && filter->id() != QLatin1String("colortransfer")) {
217 KisConfigWidget* wdg = filter->createConfigurationWidget(0, d->view->activeNode()->original(), false);
218 wdg->deleteLater();
>>> CID 304986: Null pointer dereferences (FORWARD_NULL)
>>> Passing null pointer "dynamic_cast <KisFilterConfiguration *>(KisPropertiesConfigurationSP(wdg->configuration()).data())" to "clone", which dereferences it. (The dereference happens because this is a virtual function call.)
219 config = dynamic_cast<KisFilterConfiguration*>(wdg->configuration().data())->clone();
220 }
221 else {
222 config = filter->defaultConfiguration(KisGlobalResourcesInterface::instance())->clone();
223 }
224 QObject* configuration = d->categories[d->currentCategory]->configuration(index);
** CID 248926: Uninitialized members (UNINIT_CTOR)
/home/tymon/kritadev/krita/libs/libqml/KisSketchView.cpp: 48 in KisSketchView::Private::Private(KisSketchView*)()
________________________________________________________________________________________________________
*** CID 248926: Uninitialized members (UNINIT_CTOR)
/home/tymon/kritadev/krita/libs/libqml/KisSketchView.cpp: 48 in KisSketchView::Private::Private(KisSketchView*)()
42 , canvas(0)
43 , canvasWidget(0)
44 , selectionExtras(0)
45 , undoAction(0)
46 , redoAction(0)
47 , tabletEventCount(0)
>>> CID 248926: Uninitialized members (UNINIT_CTOR)
>>> Non-static class member "savedTimer" is not initialized in this constructor nor in any functions that it calls.
48 { }
49 ~Private() {
50 delete selectionExtras;
51 }
52
53 void imageUpdated(const QRect &updated);
________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50yoiVvSSc0Ywjss83d7yOEUgcCB0VGS755ZaA-2FhoVtwbuw-3D-3DXJuj_9IaX5f-2FHpKL9E6YDsrt7GXrayr4Tk6CKCUhJvkNHrt6CGG86zC5wgwFy3CLVG0RYtGzvwPZnuZYE-2FLuQIzcLXAdiVsTyX0lJdctVTuBU-2B7Mvtw72AtyhmgnVaXo5nRAnPZhYoAtP3M2pkU8rE96qXMgD3vmV8WjVSHOnoI3AMXon0T1xFAaJPVJNoAvcyNyP4CDMEFsbATd4-2B6nZ-2BEfqRg-3D-3D
More information about the kimageshop
mailing list