New Defects reported by Coverity Scan for krita
scan-admin at coverity.com
scan-admin at coverity.com
Mon May 10 11:32:56 BST 2021
Hi,
Please find the latest report on new defect(s) introduced to krita found with Coverity Scan.
125 new defect(s) introduced to krita found with Coverity Scan.
87 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 125 defect(s)
** CID 329513: Uninitialized variables (UNINIT)
________________________________________________________________________________________________________
*** CID 329513: Uninitialized variables (UNINIT)
/home/boud/dev/krita/libs/ui/widgets/kis_custom_image_widget.cc: 314 in KisCustomImageWidget::createNewImage()()
308 double resolution ;
309 if (cmbResolutionUnit->currentText() == pixelsInchStr) {
310 resolution = doubleResolution->value() / 72.0; // internal resolution is in pixels per pt
311 } else if (cmbResolutionUnit->currentText() == pixelsCentimeterStr) {
312 resolution = doubleResolution->value() / 28.34;
313 }
>>> CID 329513: Uninitialized variables (UNINIT)
>>> Using uninitialized value "resolution" when calling "KoUnit".
314 width = static_cast<qint32>(0.5 + KoUnit(KoUnit::Pixel, resolution).toUserValuePrecise(m_width));
315 height = static_cast<qint32>(0.5 + KoUnit(KoUnit::Pixel, resolution).toUserValuePrecise(m_height));
316
317 QColor qc = cmbColor->color().toQColor();
318 qc.setAlpha(backgroundOpacity());
319 KoColor bgColor(qc, cs);
** CID 329512: Null pointer dereferences (FORWARD_NULL)
________________________________________________________________________________________________________
*** CID 329512: Null pointer dereferences (FORWARD_NULL)
/home/boud/dev/krita/libs/flake/svg/SvgStyleWriter.cpp: 406 in SvgStyleWriter::saveSvgMeshGradient(SvgMeshGradient *, const QTransform &, SvgSavingContext &)()
400 }
401
402 QString SvgStyleWriter::saveSvgMeshGradient(SvgMeshGradient *gradient,
403 const QTransform& transform,
404 SvgSavingContext &context)
405 {
>>> CID 329512: Null pointer dereferences (FORWARD_NULL)
>>> Passing null pointer "gradient" to "isValid", which dereferences it.
406 if (!gradient && gradient->isValid())
407 return QString();
408
409 const QString uid = context.createUID("meshgradient");
410 context.styleWriter().startElement("meshgradient");
411 context.styleWriter().addAttribute("id", uid);
** CID 329511: Null pointer dereferences (FORWARD_NULL)
________________________________________________________________________________________________________
*** CID 329511: Null pointer dereferences (FORWARD_NULL)
/home/boud/dev/krita/plugins/paintops/mypaint/MyPaintCurveOptionWidget.cpp: 111 in KisMyPaintCurveOptionWidget::updateRangeSpinBoxes(KisSharedPtr<KisDynamicSensor>) const()
105 KisMyPaintBrushOption* mySensor = dynamic_cast<KisMyPaintBrushOption*>(sensor.data());
106 m_curveOptionWidget->xMinBox->blockSignals(true);
107 m_curveOptionWidget->xMaxBox->blockSignals(true);
108 m_curveOptionWidget->yMinBox->blockSignals(true);
109 m_curveOptionWidget->yMaxBox->blockSignals(true);
110
>>> CID 329511: Null pointer dereferences (FORWARD_NULL)
>>> Passing null pointer "mySensor" to "getXRangeMin", which dereferences it.
111 m_curveOptionWidget->xMinBox->setValue( mySensor->getXRangeMin());
112 m_curveOptionWidget->xMaxBox->setValue( mySensor->getXRangeMax());
113 m_curveOptionWidget->yMinBox->setValue( mySensor->getYRangeMin());
114 m_curveOptionWidget->yMaxBox->setValue( mySensor->getYRangeMax());
115
116 m_curveOptionWidget->xMinBox->blockSignals(false);
** CID 329510: (USE_AFTER_FREE)
/usr/include/c++/9/bits/stl_algo.h: 1827 in std::__unguarded_linear_insert<QList<KisSharedPtr<KisNode>>::iterator, __gnu_cxx::__ops::_Val_comp_iter<CompareNodesFunctor>>(T1, T2)()
/usr/include/c++/9/bits/stl_algo.h: 1827 in std::__unguarded_linear_insert<QList<KisSharedPtr<KisCanvasDecoration>>::iterator, __gnu_cxx::__ops::_Val_comp_iter<bool (*)(KisSharedPtr<KisCanvasDecoration>, KisSharedPtr<KisCanvasDecoration>)>>(T1, T2)()
/usr/include/c++/9/bits/stl_algo.h: 1834 in std::__unguarded_linear_insert<QList<KisSharedPtr<KisCanvasDecoration>>::iterator, __gnu_cxx::__ops::_Val_comp_iter<bool (*)(KisSharedPtr<KisCanvasDecoration>, KisSharedPtr<KisCanvasDecoration>)>>(T1, T2)()
/usr/include/c++/9/bits/stl_algo.h: 1834 in std::__unguarded_linear_insert<QList<KisSharedPtr<KisNode>>::iterator, __gnu_cxx::__ops::_Val_comp_iter<CompareNodesFunctor>>(T1, T2)()
________________________________________________________________________________________________________
*** CID 329510: (USE_AFTER_FREE)
/usr/include/c++/9/bits/stl_algo.h: 1827 in std::__unguarded_linear_insert<QList<KisSharedPtr<KisNode>>::iterator, __gnu_cxx::__ops::_Val_comp_iter<CompareNodesFunctor>>(T1, T2)()
1821 _Compare __comp)
1822 {
1823 typename iterator_traits<_RandomAccessIterator>::value_type
1824 __val = _GLIBCXX_MOVE(*__last);
1825 _RandomAccessIterator __next = __last;
1826 --__next;
>>> CID 329510: (USE_AFTER_FREE)
>>> Calling "operator ()" frees pointer "__val.d" which has already been freed.
1827 while (__comp(__val, __next))
1828 {
1829 *__last = _GLIBCXX_MOVE(*__next);
1830 __last = __next;
1831 --__next;
1832 }
/usr/include/c++/9/bits/stl_algo.h: 1827 in std::__unguarded_linear_insert<QList<KisSharedPtr<KisCanvasDecoration>>::iterator, __gnu_cxx::__ops::_Val_comp_iter<bool (*)(KisSharedPtr<KisCanvasDecoration>, KisSharedPtr<KisCanvasDecoration>)>>(T1, T2)()
1821 _Compare __comp)
1822 {
1823 typename iterator_traits<_RandomAccessIterator>::value_type
1824 __val = _GLIBCXX_MOVE(*__last);
1825 _RandomAccessIterator __next = __last;
1826 --__next;
>>> CID 329510: (USE_AFTER_FREE)
>>> Calling "operator ()" frees pointer "__val.d" which has already been freed.
1827 while (__comp(__val, __next))
1828 {
1829 *__last = _GLIBCXX_MOVE(*__next);
1830 __last = __next;
1831 --__next;
1832 }
/usr/include/c++/9/bits/stl_algo.h: 1834 in std::__unguarded_linear_insert<QList<KisSharedPtr<KisCanvasDecoration>>::iterator, __gnu_cxx::__ops::_Val_comp_iter<bool (*)(KisSharedPtr<KisCanvasDecoration>, KisSharedPtr<KisCanvasDecoration>)>>(T1, T2)()
1828 {
1829 *__last = _GLIBCXX_MOVE(*__next);
1830 __last = __next;
1831 --__next;
1832 }
1833 *__last = _GLIBCXX_MOVE(__val);
>>> CID 329510: (USE_AFTER_FREE)
>>> Calling "~KisSharedPtr" frees pointer "__val.d" which has already been freed.
1834 }
1835
1836 /// This is a helper function for the sort routine.
1837 template<typename _RandomAccessIterator, typename _Compare>
1838 void
1839 __insertion_sort(_RandomAccessIterator __first,
/usr/include/c++/9/bits/stl_algo.h: 1834 in std::__unguarded_linear_insert<QList<KisSharedPtr<KisNode>>::iterator, __gnu_cxx::__ops::_Val_comp_iter<CompareNodesFunctor>>(T1, T2)()
1828 {
1829 *__last = _GLIBCXX_MOVE(*__next);
1830 __last = __next;
1831 --__next;
1832 }
1833 *__last = _GLIBCXX_MOVE(__val);
>>> CID 329510: (USE_AFTER_FREE)
>>> Calling "~KisSharedPtr" frees pointer "__val.d" which has already been freed.
1834 }
1835
1836 /// This is a helper function for the sort routine.
1837 template<typename _RandomAccessIterator, typename _Compare>
1838 void
1839 __insertion_sort(_RandomAccessIterator __first,
** CID 329509: Uninitialized members (UNINIT_CTOR)
/home/boud/dev/krita/plugins/dockers/histogram/histogramdockerwidget.h: 27 in HistogramData::HistogramData()()
________________________________________________________________________________________________________
*** CID 329509: Uninitialized members (UNINIT_CTOR)
/home/boud/dev/krita/plugins/dockers/histogram/histogramdockerwidget.h: 27 in HistogramData::HistogramData()()
21
22
23 using HistVector = std::vector<std::vector<quint32> >; //Don't use QVector here - it's too slow for this purpose
24
25 struct HistogramData
26 {
>>> CID 329509: Uninitialized members (UNINIT_CTOR)
>>> Non-static class member "colorSpace" is not initialized in this constructor nor in any functions that it calls.
27 HistogramData() {}
28 ~HistogramData() {}
29
30 HistVector bins;
31 const KoColorSpace* colorSpace;
32 };
** CID 329508: Uninitialized members (UNINIT_CTOR)
/home/boud/dev/krita/libs/image/kis_suspend_projection_updates_stroke_strategy.cpp: 66 in KisSuspendProjectionUpdatesStrokeStrategy::Private::SuspendLod0Updates::NoFilthyUpdate::NoFilthyUpdate()()
________________________________________________________________________________________________________
*** CID 329508: Uninitialized members (UNINIT_CTOR)
/home/boud/dev/krita/libs/image/kis_suspend_projection_updates_stroke_strategy.cpp: 66 in KisSuspendProjectionUpdatesStrokeStrategy::Private::SuspendLod0Updates::NoFilthyUpdate::NoFilthyUpdate()()
60
61 QRect rect;
62 QRect cropRect;
63 };
64
65 struct NoFilthyUpdate {
>>> CID 329508: Uninitialized members (UNINIT_CTOR)
>>> Non-static class member "resetAnimationCache" is not initialized in this constructor nor in any functions that it calls.
66 NoFilthyUpdate() {}
67 NoFilthyUpdate(const QRect &_rect, const QRect &_cropRect, bool _resetAnimationCache)
68 : rect(_rect), cropRect(_cropRect), resetAnimationCache(_resetAnimationCache)
69 {
70 }
71
** CID 329507: Error handling issues (CHECKED_RETURN)
/home/boud/dev/krita/libs/resources/KisTagModel.cpp: 55 in KisAllTagsModel::rowCount(const QModelIndex &) const()
________________________________________________________________________________________________________
*** CID 329507: Error handling issues (CHECKED_RETURN)
/home/boud/dev/krita/libs/resources/KisTagModel.cpp: 55 in KisAllTagsModel::rowCount(const QModelIndex &) const()
49 }
50
51 int KisAllTagsModel::rowCount(const QModelIndex &/*parent*/) const
52 {
53 if (d->cachedRowCount < 0) {
54 QSqlQuery q;
>>> CID 329507: Error handling issues (CHECKED_RETURN)
>>> Calling "prepare" without checking return value (as is done elsewhere 66 out of 73 times).
55 q.prepare("SELECT count(*)\n"
56 "FROM tags\n"
57 ", resource_types\n"
58 "WHERE tags.resource_type_id = resource_types.id\n"
59 "AND resource_types.name = :resource_type\n");
60 q.bindValue(":resource_type", d->resourceType);
** CID 329506: Low impact quality (MISSING_MOVE_ASSIGNMENT)
/home/boud/dev/krita/libs/psd/psd.h: 489 in ()
________________________________________________________________________________________________________
*** CID 329506: Low impact quality (MISSING_MOVE_ASSIGNMENT)
/home/boud/dev/krita/libs/psd/psd.h: 489 in ()
483
484 //using psd_layer_effects_shadow_base::setKnocksOut;
485 ~psd_layer_effects_drop_shadow();
486 };
487
488 // isdw: https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCywQRIzpZxbTpxiKLl1CWVeQbclvgDcebawM0WKJoRBGVmOX59RmfHtsVJlbP-2BEgzs0d63iDMbIJocMwTH1-2BI0B6t-2BI6KC76dfw1mA65mffnc4DruV7596-2Fyf7Y9IbBZcgg-3D-3DfxI7_9IaX5f-2FHpKL9E6YDsrt7GXrayr4Tk6CKCUhJvkNHrt7f7-2FXTU46-2BLfTq2k-2FpUYh6kcYYJzwKo40w9HEQ6Ee32J7xgFrES-2Fubi6KSdJk9RLupftxBjeqJSiS78me1zlXWfk0r5GY-2FjzaorjCK0eUdQdI7ElJDpFveMcnQORiQqvbeP1lLOho5z6ExrKtLqPsweKASRBj17luJacHG6eqsUyAE4pg4pQg-2FAofl-2BD4VJJI-3D
>>> CID 329506: Low impact quality (MISSING_MOVE_ASSIGNMENT)
>>> Class "psd_layer_effects_inner_shadow" may benefit from adding a move assignment operator. See other events which show the copy assignment operator being applied to rvalue(s), where a move assignment may be faster.
489 class KRITAPSD_EXPORT psd_layer_effects_inner_shadow : public psd_layer_effects_shadow_common
490 {
491 public:
492 psd_layer_effects_inner_shadow() {
493 setKnocksOut(false);
494 setInvertsSelection(true);
** CID 329505: Null pointer dereferences (FORWARD_NULL)
________________________________________________________________________________________________________
*** CID 329505: Null pointer dereferences (FORWARD_NULL)
/home/boud/dev/krita/libs/widgets/KisTagSelectionWidget.cpp: 292 in KisTagSelectionWidget::setTagList(bool, QList<KoID> &, QList<KoID> &, QList<KoID> &)()
286 }
287 delete item;
288 }
289
290
291 WdgAddTagButton* addTagButton = dynamic_cast<WdgAddTagButton*>(m_addTagButton);
>>> CID 329505: Null pointer dereferences (FORWARD_NULL)
>>> Passing null pointer "addTagButton" to "setAvailableTagsList", which dereferences it.
292 addTagButton->setAvailableTagsList(notSelected);
293
294 Q_FOREACH(KoID tag, selected) {
295 WdgCloseableLabel* label = new WdgCloseableLabel(tag, m_editable, false, this);
296 connect(label, SIGNAL(sigRemoveTagFromSelection(KoID)), this, SLOT(slotRemoveTagFromSelection(KoID)), Qt::UniqueConnection);
297 m_layout->addWidget(label);
** CID 329504: Uninitialized members (UNINIT_CTOR)
/home/boud/dev/krita/plugins/dockers/storyboarddocker/StoryboardModel.cpp: 43 in StoryboardModel::StoryboardModel(QObject *)()
________________________________________________________________________________________________________
*** CID 329504: Uninitialized members (UNINIT_CTOR)
/home/boud/dev/krita/plugins/dockers/storyboarddocker/StoryboardModel.cpp: 43 in StoryboardModel::StoryboardModel(QObject *)()
37 , m_renderScheduler(new KisStoryboardThumbnailRenderScheduler(this))
38 , m_renderSchedulingCompressor(1000,KisSignalCompressor::FIRST_ACTIVE)
39 {
40 connect(m_renderScheduler, SIGNAL(sigFrameCompleted(int, KisPaintDeviceSP)), this, SLOT(slotFrameRenderCompleted(int, KisPaintDeviceSP)));
41 connect(m_renderScheduler, SIGNAL(sigFrameCancelled(int)), this, SLOT(slotFrameRenderCancelled(int)));
42 connect(&m_renderSchedulingCompressor, SIGNAL(timeout()), this, SLOT(slotUpdateThumbnails()));
>>> CID 329504: Uninitialized members (UNINIT_CTOR)
>>> Non-static class member "m_view" is not initialized in this constructor nor in any functions that it calls.
43 }
44
45 StoryboardModel::~StoryboardModel()
46 {
47 delete m_renderScheduler;
48 }
** CID 329503: Uninitialized members (UNINIT_CTOR)
/home/boud/dev/krita/libs/image/kis_warptransform_worker.cc: 194 in KisWarpTransformWorker::KisWarpTransformWorker(KisWarpTransformWorker::WarpType_, QVector<QPointF>, QVector<QPointF>, double, KoUpdater *)()
________________________________________________________________________________________________________
*** CID 329503: Uninitialized members (UNINIT_CTOR)
/home/boud/dev/krita/libs/image/kis_warptransform_worker.cc: 194 in KisWarpTransformWorker::KisWarpTransformWorker(KisWarpTransformWorker::WarpType_, QVector<QPointF>, QVector<QPointF>, double, KoUpdater *)()
188 m_warpMathFunction = &rigidTransformMath;
189 break;
190 default:
191 m_warpMathFunction = 0;
192 break;
193 }
>>> CID 329503: Uninitialized members (UNINIT_CTOR)
>>> Non-static class member "m_warpCalc" is not initialized in this constructor nor in any functions that it calls.
194 }
195
196 KisWarpTransformWorker::~KisWarpTransformWorker()
197 {
198 }
199
** CID 329502: Uninitialized members (UNINIT_CTOR)
/home/boud/dev/krita/plugins/dockers/advancedcolorselector/kis_color_selector_ring.cpp: 26 in KisColorSelectorRing::KisColorSelectorRing(KisColorSelector *)()
________________________________________________________________________________________________________
*** CID 329502: Uninitialized members (UNINIT_CTOR)
/home/boud/dev/krita/plugins/dockers/advancedcolorselector/kis_color_selector_ring.cpp: 26 in KisColorSelectorRing::KisColorSelectorRing(KisColorSelector *)()
20 KisColorSelectorComponent(parent),
21 m_cachedColorSpace(0),
22 m_cachedSize(0),
23 m_lastHue(0),
24 m_innerRingRadiusFraction(0.85)
25 {
>>> CID 329502: Uninitialized members (UNINIT_CTOR)
>>> Non-static class member "Gamma" is not initialized in this constructor nor in any functions that it calls.
26 }
27
28 int KisColorSelectorRing::innerRadius() const
29 {
30 return (qMin(width(), height())/2)*m_innerRingRadiusFraction;
31 }
** CID 329501: Uninitialized members (UNINIT_CTOR)
/home/boud/dev/krita/plugins/tools/defaulttool/defaulttool/KoShapeMeshGradientHandles.h: 32 in KoShapeMeshGradientHandles::Handle::Handle()()
________________________________________________________________________________________________________
*** CID 329501: Uninitialized members (UNINIT_CTOR)
/home/boud/dev/krita/plugins/tools/defaulttool/defaulttool/KoShapeMeshGradientHandles.h: 32 in KoShapeMeshGradientHandles::Handle::Handle()()
26
27 enum Index {
28 First = 1,
29 Second
30 };
31
>>> CID 329501: Uninitialized members (UNINIT_CTOR)
>>> Non-static class member "index" is not initialized in this constructor nor in any functions that it calls.
32 Handle() : type(None) {}
33 Handle(Type t, const QPointF &p, int row, int col, SvgMeshPatch::Type segmentType, Index index = First)
34 : type(t) , pos(p)
35 , row(row) , col(col)
36 , segmentType(segmentType)
37 , index(index)
** CID 329500: Null pointer dereferences (FORWARD_NULL)
________________________________________________________________________________________________________
*** CID 329500: Null pointer dereferences (FORWARD_NULL)
/home/boud/dev/krita/plugins/dockers/animation/KisAnimCurvesChannelDelegate.cpp: 140 in KisAnimCurvesChannelDelegate::paintNodeBackground(const QStyleOptionViewItem &, QPainter *, const QColor &) const()
134 void KisAnimCurvesChannelDelegate::paintNodeBackground(const QStyleOptionViewItem &styleOption, QPainter *painter, const QColor &nodeColor) const
135 {
136 const bool hasValidStyle = styleOption.widget ? styleOption.widget->isEnabled() : (styleOption.state & QStyle::State_Enabled);
137 QPalette::ColorGroup cg = hasValidStyle ? QPalette::Normal : QPalette::Disabled;
138
139 QRect viewArea = styleOption.rect;
>>> CID 329500: Null pointer dereferences (FORWARD_NULL)
>>> Passing null pointer "styleOption.widget" to "rect", which dereferences it.
140 viewArea.setLeft(styleOption.widget->rect().left());
141
142 { // Highlight, Shadow and Selection Color
143 const QColor highlight = nodeColor.lighter(115);
144 const QColor shadow = nodeColor.darker(105);
145 painter->fillRect(viewArea, highlight);
** CID 329499: Error handling issues (UNCAUGHT_EXCEPT)
/home/boud/dev/krita/libs/pigment/tests/TestKoStopGradient.cpp: 50 in main()
________________________________________________________________________________________________________
*** CID 329499: Error handling issues (UNCAUGHT_EXCEPT)
/home/boud/dev/krita/libs/pigment/tests/TestKoStopGradient.cpp: 50 in main()
44 QString svgSerialization = gradient.saveSvgGradient();
45 QVERIFY2(svgSerialization.contains("icc-color"), QString("icc-color not found in serialization of cmyk gradient.").toLatin1());
46 QVERIFY2(svgSerialization.contains("color-profile"), QString("color-profile not found in serialization of cmyk gradient.").toLatin1());
47
48 }
49
>>> CID 329499: Error handling issues (UNCAUGHT_EXCEPT)
>>> In function "main(int, char **)" an exception of type "KisAssertException" is thrown and never caught.
** CID 329498: Incorrect expression (USELESS_CALL)
________________________________________________________________________________________________________
*** CID 329498: Incorrect expression (USELESS_CALL)
/home/boud/dev/krita/plugins/dockers/storyboarddocker/KisStoryboardThumbnailRenderScheduler.cpp: 59 in KisStoryboardThumbnailRenderScheduler::cancelAllFrameRendering()()
53 sortAffectedFrameQueue();
54 }
55 }
56
57 void KisStoryboardThumbnailRenderScheduler::cancelAllFrameRendering()
58 {
>>> CID 329498: Incorrect expression (USELESS_CALL)
>>> Calling "this->m_affectedFramesQueue.empty()" is only useful for its return value, which is ignored.
59 m_affectedFramesQueue.empty();
60 m_changedFramesQueue.empty();
61 if (m_renderer->isActive()) {
62 m_renderer->cancelCurrentFrameRendering();
63 }
64 m_currentFrame = -1;
** CID 329497: (FORWARD_NULL)
/home/boud/dev/krita/plugins/dockers/storyboarddocker/StoryboardDelegate.cpp: 353 in StoryboardDelegate::editorEvent(QEvent *, QAbstractItemModel *, const QStyleOptionViewItem &, const QModelIndex &)()
/home/boud/dev/krita/plugins/dockers/storyboarddocker/StoryboardDelegate.cpp: 342 in StoryboardDelegate::editorEvent(QEvent *, QAbstractItemModel *, const QStyleOptionViewItem &, const QModelIndex &)()
________________________________________________________________________________________________________
*** CID 329497: (FORWARD_NULL)
/home/boud/dev/krita/plugins/dockers/storyboarddocker/StoryboardDelegate.cpp: 353 in StoryboardDelegate::editorEvent(QEvent *, QAbstractItemModel *, const QStyleOptionViewItem &, const QModelIndex &)()
347 else if (leftButton && downButtonClicked) {
348 KisStoryboardChildEditCommand *cmd = new KisStoryboardChildEditCommand(index.data(),
349 index.data().toInt() - 1,
350 index.parent().row(),
351 index.row(),
352 sbModel);
>>> CID 329497: (FORWARD_NULL)
>>> Passing null pointer "sbModel" to "setData", which dereferences it. (The dereference happens because this is a virtual function call.)
353 if (sbModel->setData(index, index.data().toInt() - 1)) {
354 sbModel->pushUndoCommand(cmd);
355 }
356 return true;
357 }
358 }
/home/boud/dev/krita/plugins/dockers/storyboarddocker/StoryboardDelegate.cpp: 395 in StoryboardDelegate::editorEvent(QEvent *, QAbstractItemModel *, const QStyleOptionViewItem &, const QModelIndex &)()
389
390 bool addItemButtonClicked = addItemButton.isValid() && addItemButton.contains(mouseEvent->pos());
391 bool deleteItemButtonClicked = deleteItemButton.isValid() && deleteItemButton.contains(mouseEvent->pos());
392
393 StoryboardModel* sbModel = dynamic_cast<StoryboardModel*>(model);
394 if (leftButton && addItemButtonClicked) {
>>> CID 329497: (FORWARD_NULL)
>>> Passing null pointer "sbModel" to "insertItem", which dereferences it.
395 sbModel->insertItem(index.parent(), true);
396 return true;
397 }
398 else if (leftButton && deleteItemButtonClicked) {
399 int row = index.parent().row();
400 KisRemoveStoryboardCommand *command = new KisRemoveStoryboardCommand(row, sbModel->getData().at(row), sbModel);
/home/boud/dev/krita/plugins/dockers/storyboarddocker/StoryboardDelegate.cpp: 400 in StoryboardDelegate::editorEvent(QEvent *, QAbstractItemModel *, const QStyleOptionViewItem &, const QModelIndex &)()
394 if (leftButton && addItemButtonClicked) {
395 sbModel->insertItem(index.parent(), true);
396 return true;
397 }
398 else if (leftButton && deleteItemButtonClicked) {
399 int row = index.parent().row();
>>> CID 329497: (FORWARD_NULL)
>>> Passing null pointer "sbModel" to "getData", which dereferences it.
400 KisRemoveStoryboardCommand *command = new KisRemoveStoryboardCommand(row, sbModel->getData().at(row), sbModel);
401
402 sbModel->removeItem(index.parent(), command);
403 sbModel->pushUndoCommand(command);
404 return true;
405 }
/home/boud/dev/krita/plugins/dockers/storyboarddocker/StoryboardDelegate.cpp: 342 in StoryboardDelegate::editorEvent(QEvent *, QAbstractItemModel *, const QStyleOptionViewItem &, const QModelIndex &)()
336 if (leftButton && upButtonClicked) {
337 KisStoryboardChildEditCommand *cmd = new KisStoryboardChildEditCommand(index.data(),
338 index.data().toInt() + 1,
339 index.parent().row(),
340 index.row(),
341 sbModel);
>>> CID 329497: (FORWARD_NULL)
>>> Passing null pointer "sbModel" to "setData", which dereferences it. (The dereference happens because this is a virtual function call.)
342 if (sbModel->setData(index, index.data().toInt() + 1)) {
343 sbModel->pushUndoCommand(cmd);
344 }
345 return true;
346 }
347 else if (leftButton && downButtonClicked) {
** CID 329496: Null pointer dereferences (FORWARD_NULL)
________________________________________________________________________________________________________
*** CID 329496: Null pointer dereferences (FORWARD_NULL)
/home/boud/dev/krita/plugins/generators/gradient/KisGradientGeneratorConfiguration.cpp: 286 in KisGradientGeneratorConfiguration::setGradient(QSharedPointer<KoAbstractGradient>)()
280 QDomDocument document;
281 QDomElement gradientElement = document.createElement("gradient");
282 gradientElement.setAttribute("name", newGradient->name());
283
284 if (dynamic_cast<KoStopGradient*>(newGradient.data())) {
285 KoStopGradient *gradient = dynamic_cast<KoStopGradient*>(newGradient.data());
>>> CID 329496: Null pointer dereferences (FORWARD_NULL)
>>> Passing null pointer "gradient" to "toXML", which dereferences it.
286 gradient->toXML(document, gradientElement);
287 } else if (dynamic_cast<KoSegmentGradient*>(newGradient.data())) {
288 KoSegmentGradient *gradient = dynamic_cast<KoSegmentGradient*>(newGradient.data());
289 gradient->toXML(document, gradientElement);
290 }
291
** CID 329495: Null pointer dereferences (FORWARD_NULL)
________________________________________________________________________________________________________
*** CID 329495: Null pointer dereferences (FORWARD_NULL)
/home/boud/dev/krita/plugins/dockers/storyboarddocker/StoryboardDelegate.cpp: 146 in StoryboardDelegate::paint(QPainter *, const QStyleOptionViewItem &, const QModelIndex &) const()
140 drawSpinBox(p, option, data, i18nc("suffix in spin box in storyboard that means 'frames'", "f"));
141 break;
142 }
143 default:
144 {
145 const StoryboardModel* model = dynamic_cast<const StoryboardModel*>(index.model());
>>> CID 329495: Null pointer dereferences (FORWARD_NULL)
>>> Passing null pointer "model" to "getComment", which dereferences it.
146 if (m_view->commentIsVisible() && model->getComment(index.row() - 4).visibility) {
147 p->setPen(QPen(option.palette.dark(), 2));
148 drawComment(p, option, index);
149 }
150 break;
151 }
** CID 329494: (FORWARD_NULL)
________________________________________________________________________________________________________
*** CID 329494: (FORWARD_NULL)
/home/boud/dev/krita/plugins/dockers/storyboarddocker/StoryboardDelegate.cpp: 378 in StoryboardDelegate::editorEvent(QEvent *, QAbstractItemModel *, const QStyleOptionViewItem &, const QModelIndex &)()
372 return true;
373 }
374 else if (leftButton && downButtonClicked) {
375 int lastValue = model->data(index, Qt::UserRole).toInt();
376 int value = lastValue + option.fontMetrics.height();
377 StoryboardModel* modelSB = dynamic_cast<StoryboardModel*>(model);
>>> CID 329494: (FORWARD_NULL)
>>> Passing null pointer "modelSB" to "setCommentScrollData", which dereferences it.
378 modelSB->setCommentScrollData(index, qMin(scrollBarOption.maximum, value));
379 return true;
380 }
381 }
382
383 else if (index.parent().isValid() && index.row() == StoryboardItem::FrameNumber && m_view->thumbnailIsVisible()) { //thumbnail add/delete events
/home/boud/dev/krita/plugins/dockers/storyboarddocker/StoryboardDelegate.cpp: 371 in StoryboardDelegate::editorEvent(QEvent *, QAbstractItemModel *, const QStyleOptionViewItem &, const QModelIndex &)()
365 bool downButtonClicked = downButton.isValid() && downButton.contains(mouseEvent->pos());
366
367 if (leftButton && upButtonClicked) {
368 int lastValue = model->data(index, Qt::UserRole).toInt();
369 int value = lastValue - option.fontMetrics.height();
370 StoryboardModel* modelSB = dynamic_cast<StoryboardModel*>(model);
>>> CID 329494: (FORWARD_NULL)
>>> Passing null pointer "modelSB" to "setCommentScrollData", which dereferences it.
371 modelSB->setCommentScrollData(index, qMax(0, value));
372 return true;
373 }
374 else if (leftButton && downButtonClicked) {
375 int lastValue = model->data(index, Qt::UserRole).toInt();
376 int value = lastValue + option.fontMetrics.height();
/home/boud/dev/krita/plugins/dockers/storyboarddocker/StoryboardDelegate.cpp: 425 in StoryboardDelegate::editorEvent(QEvent *, QAbstractItemModel *, const QStyleOptionViewItem &, const QModelIndex &)()
419 if (leftButton && index.parent().isValid() && index.row() >= StoryboardItem::Comments) {
420 if (lastClickPosInScroll && currClickPosInScroll) {
421 int lastValue = model->data(index, Qt::UserRole).toInt();
422 int value = lastValue + mouseEvent->pos().y() - m_lastDragPos.y();
423 StoryboardModel* modelSB = dynamic_cast<StoryboardModel*>(model);
424 if (value >= 0 && value <= scrollBarOption.maximum) {
>>> CID 329494: (FORWARD_NULL)
>>> Passing null pointer "modelSB" to "setCommentScrollData", which dereferences it.
425 modelSB->setCommentScrollData(index, value);
426 return true;
427 }
428 return false;
429 }
430 m_lastDragPos = mouseEvent->pos();
________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50yoiVvSSc0Ywjss83d7yOEUgcCB0VGS755ZaA-2FhoVtwbuw-3D-3DPcY5_9IaX5f-2FHpKL9E6YDsrt7GXrayr4Tk6CKCUhJvkNHrt7f7-2FXTU46-2BLfTq2k-2FpUYh6SctJJ2i33fT1ZV-2FrkirfXWxruN8aw-2BXYpo59pvr2Ada2TkQfTjd9S5uqdhnT-2FXX96fBUnP-2FLcQKXiM-2BD2moSqwZrNfpH4KLXAqcbr40zWza5HV4sTcLCS6E8GVn4Py-2BlLDgEf7BsaqRghHw-2BNsOhdELeJfM8B8w2dWqB7bg-2Flew-3D
More information about the kimageshop
mailing list