New Defects reported by Coverity Scan for krita

scan-admin at coverity.com scan-admin at coverity.com
Sun Sep 1 17:19:14 BST 2019


Hi,

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

400 new defect(s) introduced to krita found with Coverity Scan.
1722 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 400 defect(s)


** CID 248998:  Null pointer dereferences  (FORWARD_NULL)
/home/boud/dev/krita/libs/libkis/FilterMask.cpp: 30 in FilterMask::FilterMask(KisSharedPtr<KisImage>, QString, Filter &, QObject *)()


________________________________________________________________________________________________________
*** CID 248998:  Null pointer dereferences  (FORWARD_NULL)
/home/boud/dev/krita/libs/libkis/FilterMask.cpp: 30 in FilterMask::FilterMask(KisSharedPtr<KisImage>, QString, Filter &, QObject *)()
24     
25     FilterMask::FilterMask(KisImageSP image, QString name, Filter &filter, QObject *parent) :
26         Node(image, new KisFilterMask(), parent)
27     {
28         this->node()->setName(name);
29         KisFilterMask *mask = dynamic_cast<KisFilterMask*>(this->node().data());
>>>     CID 248998:  Null pointer dereferences  (FORWARD_NULL)
>>>     Passing null pointer "mask" to "setFilter", which dereferences it. (The dereference happens because this is a virtual function call.)
30         mask->setFilter(filter.filterConfig());
31     }
32     
33     FilterMask::FilterMask(KisImageSP image, KisFilterMaskSP mask, QObject *parent):
34         Node(image, mask, parent)
35     {

** CID 248997:  Uninitialized members  (UNINIT_CTOR)
/home/boud/dev/krita/libs/widgets/KoToolBox.cpp: 73 in KoToolBox::Private::Private()()


________________________________________________________________________________________________________
*** CID 248997:  Uninitialized members  (UNINIT_CTOR)
/home/boud/dev/krita/libs/widgets/KoToolBox.cpp: 73 in KoToolBox::Private::Private()()
67         Private()
68             : layout(0)
69             , buttonGroup(0)
70             , floating(false)
71             , contextSize(0)
72         {
>>>     CID 248997:  Uninitialized members  (UNINIT_CTOR)
>>>     Non-static class member "orientation" is not initialized in this constructor nor in any functions that it calls.
73         }
74     
75         void addSection(Section *section, const QString &name);
76     
77         QList<QToolButton*> buttons;
78         QMap<QString, Section*> sections;

** CID 248996:  Null pointer dereferences  (FORWARD_NULL)
/home/boud/dev/krita/libs/ui/input/kis_zoom_action.cpp: 103 in KisZoomAction::Private::zoomTo(bool, const QPoint &)()


________________________________________________________________________________________________________
*** CID 248996:  Null pointer dereferences  (FORWARD_NULL)
/home/boud/dev/krita/libs/ui/input/kis_zoom_action.cpp: 103 in KisZoomAction::Private::zoomTo(bool, const QPoint &)()
97                 zoomAction->nextZoomLevel() : zoomAction->prevZoomLevel();
98     
99             KoCanvasControllerWidget *controller =
100                 dynamic_cast<KoCanvasControllerWidget*>(
101                     q->inputManager()->canvas()->canvasController());
102     
>>>     CID 248996:  Null pointer dereferences  (FORWARD_NULL)
>>>     Passing null pointer "controller" to "zoomRelativeToPoint", which dereferences it. (The dereference happens because this is a virtual function call.)
103             controller->zoomRelativeToPoint(point, newZoom / oldZoom);
104         } else {
105             if (zoomIn) {
106                 zoomAction->zoomIn();
107             } else {
108                 zoomAction->zoomOut();

** CID 248995:  Uninitialized members  (UNINIT_CTOR)
/home/boud/dev/krita/libs/image/commands/kis_image_set_projection_color_space_command.cpp: 36 in KisImageSetProjectionColorSpaceCommand::KisImageSetProjectionColorSpaceCommand(KisWeakSharedPtr<KisImage>, const KoColorSpace *)()


________________________________________________________________________________________________________
*** CID 248995:  Uninitialized members  (UNINIT_CTOR)
/home/boud/dev/krita/libs/image/commands/kis_image_set_projection_color_space_command.cpp: 36 in KisImageSetProjectionColorSpaceCommand::KisImageSetProjectionColorSpaceCommand(KisWeakSharedPtr<KisImage>, const KoColorSpace *)()
30     {
31         KisImageSP imageSP = image.toStrongRef();
32         if (imageSP) {
33             m_beforeColorSpace = imageSP->colorSpace();
34             m_afterColorSpace = afterColorSpace;
35         }
>>>     CID 248995:  Uninitialized members  (UNINIT_CTOR)
>>>     Non-static class member "m_afterColorSpace" is not initialized in this constructor nor in any functions that it calls.
36     }
37     
38     void KisImageSetProjectionColorSpaceCommand::redo()
39     {
40         KisImageSP image = m_image.toStrongRef();
41         if (image) {

** CID 248994:    (UNCAUGHT_EXCEPT)
/home/boud/dev/krita/libs/image/tiles3/kis_hline_iterator.cpp: 162 in KisHLineIterator2::~KisHLineIterator2()()
/home/boud/dev/krita/libs/image/tiles3/kis_hline_iterator.cpp: 162 in KisHLineIterator2::~KisHLineIterator2()()


________________________________________________________________________________________________________
*** CID 248994:    (UNCAUGHT_EXCEPT)
/home/boud/dev/krita/libs/image/tiles3/kis_hline_iterator.cpp: 162 in KisHLineIterator2::~KisHLineIterator2()()
156         }
157         return m_havePixels;
158     }
159     
160     
161     
>>>     CID 248994:    (UNCAUGHT_EXCEPT)
>>>     An exception of type "KisAssertException" is thrown but the throw list "noexcept" doesn't allow it to be thrown. This will cause a call to unexpected() which usually calls terminate().
162     KisHLineIterator2::~KisHLineIterator2()
163     {
164         for (uint i = 0; i < m_tilesCacheSize; i++) {
165             unlockTile(m_tilesCache[i].tile);
166             unlockOldTile(m_tilesCache[i].oldtile);
167         }
/home/boud/dev/krita/libs/image/tiles3/kis_hline_iterator.cpp: 162 in KisHLineIterator2::~KisHLineIterator2()()
156         }
157         return m_havePixels;
158     }
159     
160     
161     
>>>     CID 248994:    (UNCAUGHT_EXCEPT)
>>>     An exception of type "KisAssertException" is thrown but the throw list "noexcept" doesn't allow it to be thrown. This will cause a call to unexpected() which usually calls terminate().
162     KisHLineIterator2::~KisHLineIterator2()
163     {
164         for (uint i = 0; i < m_tilesCacheSize; i++) {
165             unlockTile(m_tilesCache[i].tile);
166             unlockOldTile(m_tilesCache[i].oldtile);
167         }

** CID 248993:    (FORWARD_NULL)


________________________________________________________________________________________________________
*** CID 248993:    (FORWARD_NULL)
/home/boud/dev/krita/libs/ui/KisMainWindow.cpp: 1408 in KisMainWindow::setActiveView(KisView *)()
1402         if (d->undoActionsUpdateManager) {
1403             d->undoActionsUpdateManager->setCurrentDocument(view ? view->document() : 0);
1404         }
1405     
1406         d->viewManager->setCurrentView(view);
1407     
>>>     CID 248993:    (FORWARD_NULL)
>>>     Passing null pointer "view" to "document", which dereferences it.
1408         KisWindowLayoutManager::instance()->activeDocumentChanged(view->document());
1409     }
1410     
1411     void KisMainWindow::dragMove(QDragMoveEvent * event)
1412     {
1413         QTabBar *tabBar = d->findTabBarHACK();
/home/boud/dev/krita/libs/ui/KisMainWindow.cpp: 1406 in KisMainWindow::setActiveView(KisView *)()
1400         updateCaption();
1401     
1402         if (d->undoActionsUpdateManager) {
1403             d->undoActionsUpdateManager->setCurrentDocument(view ? view->document() : 0);
1404         }
1405     
>>>     CID 248993:    (FORWARD_NULL)
>>>     Passing null pointer "view" to "setCurrentView", which dereferences it.
1406         d->viewManager->setCurrentView(view);
1407     
1408         KisWindowLayoutManager::instance()->activeDocumentChanged(view->document());
1409     }
1410     
1411     void KisMainWindow::dragMove(QDragMoveEvent * event)

** CID 248992:  Uninitialized members  (UNINIT_CTOR)
/home/boud/dev/krita/plugins/dockers/animation/kis_zoom_button.cpp: 31 in KisZoomButton::KisZoomButton(QWidget *)()


________________________________________________________________________________________________________
*** CID 248992:  Uninitialized members  (UNINIT_CTOR)
/home/boud/dev/krita/plugins/dockers/animation/kis_zoom_button.cpp: 31 in KisZoomButton::KisZoomButton(QWidget *)()
25     KisZoomButton::KisZoomButton(QWidget *parent)
26         : KisDraggableToolButton(parent)
27         , m_zoomLevel(1.0)
28     {
29         connect(this, &KisZoomButton::valueChanged,
30                 this, &KisZoomButton::slotValueChanged);
>>>     CID 248992:  Uninitialized members  (UNINIT_CTOR)
>>>     Non-static class member "m_initialDragZoomLevel" is not initialized in this constructor nor in any functions that it calls.
31     }
32     
33     KisZoomButton::~KisZoomButton()
34     {}
35     
36     qreal KisZoomButton::zoomLevel() const

** CID 248991:  Low impact quality  (MISSING_MOVE_ASSIGNMENT)
/home/boud/dev/krita/plugins/flake/textshape/kotext/styles/Styles_p.h: 27 in ()


________________________________________________________________________________________________________
*** CID 248991:  Low impact quality  (MISSING_MOVE_ASSIGNMENT)
/home/boud/dev/krita/plugins/flake/textshape/kotext/styles/Styles_p.h: 27 in ()
21     #ifndef KOTEXT_STYLES_PRIVATE_H
22     #define KOTEXT_STYLES_PRIVATE_H
23     
24     #include <QVariant>
25     #include <QMap>
26     
>>>     CID 248991:  Low impact quality  (MISSING_MOVE_ASSIGNMENT)
>>>     Class "StylePrivate" 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.
27     class StylePrivate
28     {
29     public:
30         StylePrivate();
31         StylePrivate(const StylePrivate &other);
32         StylePrivate(const QMap<int, QVariant> &other);

** CID 248990:  Resource leaks  (RESOURCE_LEAK)
/home/boud/dev/krita/libs/flake/tests/TestKoMarkerCollection.cpp: 66 in TestKoMarkerCollection::testDeduplication()()


________________________________________________________________________________________________________
*** CID 248990:  Resource leaks  (RESOURCE_LEAK)
/home/boud/dev/krita/libs/flake/tests/TestKoMarkerCollection.cpp: 66 in TestKoMarkerCollection::testDeduplication()()
60     
61         KoMarker *marker(new KoMarker());
62         marker->setAutoOrientation(true);
63         marker->setShapes({shape1});
64     
65         KoMarkerCollection collection;
>>>     CID 248990:  Resource leaks  (RESOURCE_LEAK)
>>>     Variable "marker" going out of scope leaks the storage it points to.
66         QCOMPARE(collection.markers().size(), 1);
67     
68         KoMarker *clonedMarker = new KoMarker(*marker);
69     
70         collection.addMarker(marker);
71         QCOMPARE(collection.markers().size(), 2);

** CID 248989:  Null pointer dereferences  (FORWARD_NULL)


________________________________________________________________________________________________________
*** CID 248989:  Null pointer dereferences  (FORWARD_NULL)
/home/boud/dev/krita/libs/ui/dialogs/kis_dlg_layer_style.cpp: 257 in checkCustomNameAvailable(const QString &)()
251     
252         KoResource *resource = server->resourceByName(customName);
253         if (!resource) return true;
254     
255         KisPSDLayerStyleCollectionResource *collection = dynamic_cast<KisPSDLayerStyleCollectionResource*>(resource);
256     
>>>     CID 248989:  Null pointer dereferences  (FORWARD_NULL)
>>>     Passing null pointer "collection" to "layerStyles", which dereferences it.
257         Q_FOREACH (KisPSDLayerStyleSP style, collection->layerStyles()) {
258             if (style->name() == name) {
259                 return false;
260             }
261         }
262     

** CID 248988:  Uninitialized members  (UNINIT_CTOR)
/home/boud/dev/krita/libs/image/kis_keyframe.cpp: 47 in KisKeyframe::Private::Private(KisKeyframeChannel *, int)()


________________________________________________________________________________________________________
*** CID 248988:  Uninitialized members  (UNINIT_CTOR)
/home/boud/dev/krita/libs/image/kis_keyframe.cpp: 47 in KisKeyframe::Private::Private(KisKeyframeChannel *, int)()
41         QPointF leftTangent;
42         QPointF rightTangent;
43         int colorLabel{0};
44     
45         Private(KisKeyframeChannel *channel, int time)
46             : channel(channel), time(time), interpolationMode(Constant)
>>>     CID 248988:  Uninitialized members  (UNINIT_CTOR)
>>>     Non-static class member "tangentsMode" is not initialized in this constructor nor in any functions that it calls.
47         {}
48     };
49     
50     KisKeyframe::KisKeyframe(KisKeyframeChannel *channel, int time)
51         : m_d(new Private(channel, time))
52     {

** CID 248987:  Integer handling issues  (INCOMPATIBLE_CAST)


________________________________________________________________________________________________________
*** CID 248987:  Integer handling issues  (INCOMPATIBLE_CAST)
/usr/include/Vc/sse/intrinsics.h: 79 in Vc_1::SseIntrinsics::_mm_setallone_ps()()
73         static Vc_INTRINSIC Vc_CONST __m128  _mm_add_ps(__m128  a, __m128  b) { return static_cast<__m128 >(static_cast<__v4sf>(a) + static_cast<__v4sf>(b)); }
74         static Vc_INTRINSIC Vc_CONST __m128  _mm_sub_ps(__m128  a, __m128  b) { return static_cast<__m128 >(static_cast<__v4sf>(a) - static_cast<__v4sf>(b)); }
75     #endif
76     
77         static Vc_INTRINSIC Vc_CONST __m128i _mm_setallone_si128() { return _mm_load_si128(reinterpret_cast<const __m128i *>(Common::AllBitsSet)); }
78         static Vc_INTRINSIC Vc_CONST __m128d _mm_setallone_pd() { return _mm_load_pd(reinterpret_cast<const double *>(Common::AllBitsSet)); }
>>>     CID 248987:  Integer handling issues  (INCOMPATIBLE_CAST)
>>>     Pointer "Vc_1::Common::AllBitsSet" points to an object whose effective type is "unsigned int" (integral) but is dereferenced as a "float" (floating point). The cast will not convert the value of the object.
79         static Vc_INTRINSIC Vc_CONST __m128  _mm_setallone_ps() { return _mm_load_ps(reinterpret_cast<const float *>(Common::AllBitsSet)); }
80     
81         static Vc_INTRINSIC __m128i Vc_CONST _mm_setone_epi8 ()  { return _mm_set1_epi8(1); }
82         static Vc_INTRINSIC __m128i Vc_CONST _mm_setone_epu8 ()  { return _mm_setone_epi8(); }
83         static Vc_INTRINSIC __m128i Vc_CONST _mm_setone_epi16()  { return _mm_load_si128(reinterpret_cast<const __m128i *>(c_general::one16)); }
84         static Vc_INTRINSIC __m128i Vc_CONST _mm_setone_epu16()  { return _mm_setone_epi16(); }

** CID 248986:  Low impact quality  (MISSING_MOVE_ASSIGNMENT)
/home/boud/dev/krita/libs/image/kis_cubic_curve.h: 35 in ()


________________________________________________________________________________________________________
*** CID 248986:  Low impact quality  (MISSING_MOVE_ASSIGNMENT)
/home/boud/dev/krita/libs/image/kis_cubic_curve.h: 35 in ()
29     
30     const QString DEFAULT_CURVE_STRING = "0,0;1,1;";
31     
32     /**
33      * Hold the data for a cubic curve.
34      */
>>>     CID 248986:  Low impact quality  (MISSING_MOVE_ASSIGNMENT)
>>>     Class "KisCubicCurve" 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.
35     class KRITAIMAGE_EXPORT KisCubicCurve
36     {
37     public:
38         KisCubicCurve();
39         KisCubicCurve(const QList<QPointF>& points);
40         KisCubicCurve(const QVector<QPointF>& points);

** CID 248985:    (DIVIDE_BY_ZERO)
/home/boud/dev/krita/libs/libkis/Palette.cpp: 105 in Palette::colorSetEntryFromGroup(int, const QString &)()
/home/boud/dev/krita/libs/libkis/Palette.cpp: 104 in Palette::colorSetEntryFromGroup(int, const QString &)()


________________________________________________________________________________________________________
*** CID 248985:    (DIVIDE_BY_ZERO)
/home/boud/dev/krita/libs/libkis/Palette.cpp: 105 in Palette::colorSetEntryFromGroup(int, const QString &)()
99     }
100     
101     Swatch *Palette::colorSetEntryFromGroup(int index, const QString &groupName)
102     {
103         if (!d->palette) return new Swatch();
104         int row = index % columnCount();
>>>     CID 248985:    (DIVIDE_BY_ZERO)
>>>     In expression "(index - row) / this->columnCount()", division by expression "this->columnCount()" which may be zero has undefined behavior.
105         return new Swatch(d->palette->getColorGroup((index - row) / columnCount(), row, groupName));
106     }
107     
108     void Palette::addEntry(Swatch entry, QString groupName)
109     {
110         d->palette->add(entry.kisSwatch(), groupName);
/home/boud/dev/krita/libs/libkis/Palette.cpp: 104 in Palette::colorSetEntryFromGroup(int, const QString &)()
98         return new Swatch(d->palette->getColorGlobal(col, row));
99     }
100     
101     Swatch *Palette::colorSetEntryFromGroup(int index, const QString &groupName)
102     {
103         if (!d->palette) return new Swatch();
>>>     CID 248985:    (DIVIDE_BY_ZERO)
>>>     In expression "index % this->columnCount()", modulo by expression "this->columnCount()" which may be zero has undefined behavior.
104         int row = index % columnCount();
105         return new Swatch(d->palette->getColorGroup((index - row) / columnCount(), row, groupName));
106     }
107     
108     void Palette::addEntry(Swatch entry, QString groupName)
109     {

** CID 248984:  Uninitialized members  (UNINIT_CTOR)
/home/boud/dev/krita/libs/widgetutils/xmlgui/kxmlguibuilder.cpp: 52 in KXMLGUIBuilderPrivate::KXMLGUIBuilderPrivate()()


________________________________________________________________________________________________________
*** CID 248984:  Uninitialized members  (UNINIT_CTOR)
/home/boud/dev/krita/libs/widgetutils/xmlgui/kxmlguibuilder.cpp: 52 in KXMLGUIBuilderPrivate::KXMLGUIBuilderPrivate()()
46     
47     using namespace KDEPrivate;
48     
49     class KXMLGUIBuilderPrivate
50     {
51     public:
>>>     CID 248984:  Uninitialized members  (UNINIT_CTOR)
>>>     Non-static class member "m_menumenuhandler" is not initialized in this constructor nor in any functions that it calls.
52         KXMLGUIBuilderPrivate() : m_client(0L)  {}
53         ~KXMLGUIBuilderPrivate() { }
54     
55         QWidget *m_widget;
56     
57         QString tagMainWindow;

** CID 248983:  Integer handling issues  (SIGN_EXTENSION)
/home/boud/dev/krita/plugins/impex/raw/3rdparty/libkdcraw/src/kdcraw.cpp: 453 in KDcrawIface::KDcraw::extractRAWData(const QString &, QByteArray &, KDcrawIface::DcrawInfoContainer &, unsigned int)()


________________________________________________________________________________________________________
*** CID 248983:  Integer handling issues  (SIGN_EXTENSION)
/home/boud/dev/krita/plugins/impex/raw/3rdparty/libkdcraw/src/kdcraw.cpp: 453 in KDcrawIface::KDcraw::extractRAWData(const QString &, QByteArray &, KDcrawIface::DcrawInfoContainer &, unsigned int)()
447                     }
448                 }
449             }
450         }
451         else
452         {
>>>     CID 248983:  Integer handling issues  (SIGN_EXTENSION)
>>>     Suspicious implicit sign extension: "raw.imgdata.sizes.iwidth" with type "ushort" (16 bits, unsigned) is promoted in "raw.imgdata.sizes.iwidth * raw.imgdata.sizes.iheight" to type "int" (32 bits, signed), then sign-extended to type "unsigned long" (64 bits, unsigned).  If "raw.imgdata.sizes.iwidth * raw.imgdata.sizes.iheight" is greater than 0x7FFFFFFF, the upper bits of the result will all be 1.
453             rawData.resize((int)(raw.imgdata.sizes.iwidth * raw.imgdata.sizes.iheight * sizeof(unsigned short)));
454     
455             unsigned short* output = reinterpret_cast<unsigned short*>(rawData.data());
456     
457             for (uint row = 0; row < raw.imgdata.sizes.iheight; row++)
458             {

** CID 248982:  Performance inefficiencies  (PASS_BY_VALUE)
/home/boud/dev/krita/libs/image/KisRunnableStrokeJobUtils.h: 41 in KritaUtils::addJobBarrier<TransformStrokeStrategy::initStrokeCallback()::[lambda() (instance 2)], KisStrokeJobData>(QVector<T2 *> &, T1)()


________________________________________________________________________________________________________
*** CID 248982:  Performance inefficiencies  (PASS_BY_VALUE)
/home/boud/dev/krita/libs/image/KisRunnableStrokeJobUtils.h: 41 in KritaUtils::addJobBarrier<TransformStrokeStrategy::initStrokeCallback()::[lambda() (instance 2)], KisStrokeJobData>(QVector<T2 *> &, T1)()
35     template <typename Func, typename Job>
36     void addJobConcurrent(QVector<Job*> &jobs, Func func) {
37         jobs.append(new KisRunnableStrokeJobData(func, KisStrokeJobData::CONCURRENT));
38     }
39     
40     template <typename Func, typename Job>
>>>     CID 248982:  Performance inefficiencies  (PASS_BY_VALUE)
>>>     Passing parameter func of type "TransformStrokeStrategy::initStrokeCallback()::[lambda() (instance 2)]" (size 344 bytes) by value.
41     void addJobBarrier(QVector<Job*> &jobs, Func func) {
42         jobs.append(new KisRunnableStrokeJobData(func, KisStrokeJobData::BARRIER));
43     }
44     
45     template <typename Func, typename Job>
46     void addJobUniquelyCuncurrent(QVector<Job*> &jobs, Func func) {

** CID 248981:  Low impact quality  (MISSING_MOVE_ASSIGNMENT)
/home/boud/dev/krita/libs/psd/psd.h: 229 in ()


________________________________________________________________________________________________________
*** CID 248981:  Low impact quality  (MISSING_MOVE_ASSIGNMENT)
/home/boud/dev/krita/libs/psd/psd.h: 229 in ()
223         bool keep_original;
224     };
225     
226     #define PSD_LOOKUP_TABLE_SIZE 256
227     
228     // dsdw, isdw: https://u2389337.ct.sendgrid.net/wf/click?upn=eMT-2BqXhL85kf4kjMp0VpWH4l2I0WfPWFK-2BX6uDyv1YQlElvFdnzWUpu2U3JUdPPAn-2BNzYEgwbdJ5zIwl0Rh1pBSYCOp215Ci7cZb-2FeqSI7mEIj-2Br7CgoegLj35IZNyFA-2FG26ap6TZVVUON3zh81SsQ-3D-3D_H2sGkMRRC1DUE-2Bievv2oNsjuK-2BXMiz8ix5dOOV7MqeWxkeQWaQmyEFxu-2F3jJ4WWFTYQPTofadr4-2B5OruJzwo4cCv729K7FwMbKMVFn8vtdGCkD1ySyYvpyoLKj5p3SCY-2BznMBNmzTLogvy85pvI-2Bhj4LSmpSH6140WSkckfQ34LaUkdJaoab5NM6wDMDAuJ1Yu937wTQbZT-2FeGIjybzpdg-3D-3D
>>>     CID 248981:  Low impact quality  (MISSING_MOVE_ASSIGNMENT)
>>>     Class "psd_layer_effects_shadow_base" 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.
229     class KRITAPSD_EXPORT psd_layer_effects_shadow_base {
230     public:
231         psd_layer_effects_shadow_base()
232             : m_invertsSelection(false)
233             , m_edgeHidden(true)
234             , m_effectEnabled(false)

** CID 248980:  Code maintainability issues  (UNUSED_VALUE)
/home/boud/dev/krita/plugins/impex/libkra/kis_kra_load_visitor.cpp: 254 in KisKraLoadVisitor::visit(KisAdjustmentLayer *)()


________________________________________________________________________________________________________
*** CID 248980:  Code maintainability issues  (UNUSED_VALUE)
/home/boud/dev/krita/plugins/impex/libkra/kis_kra_load_visitor.cpp: 254 in KisKraLoadVisitor::visit(KisAdjustmentLayer *)()
248         // Adjustmentlayers are tricky: there's the 1.x style and the 2.x
249         // style, which has selections with selection components
250         bool result = true;
251         if (m_syntaxVersion == 1) {
252             KisSelectionSP selection = new KisSelection();
253             KisPixelSelectionSP pixelSelection = selection->pixelSelection();
>>>     CID 248980:  Code maintainability issues  (UNUSED_VALUE)
>>>     Assigning value from "this->loadPaintDevice(KisPaintDeviceSP(pixelSelection.operator KisSharedPtr()), QString(this->getLocation(layer, QString const(".selection"))))" to "result" here, but that stored value is overwritten before it can be used.
254             result = loadPaintDevice(pixelSelection, getLocation(layer, ".selection"));
255             layer->setInternalSelection(selection);
256         } else if (m_syntaxVersion == 2) {
257             result = loadSelection(getLocation(layer), layer->internalSelection());
258     
259         } else {

** CID 248979:  Control flow issues  (UNREACHABLE)
/home/boud/dev/krita/libs/ui/input/kis_input_manager_p.cpp: 549 in KisInputManager::Private::addNativeGestureShortcut(KisAbstractInputAction *, int, KisShortcutConfiguration::GestureAction)()


________________________________________________________________________________________________________
*** CID 248979:  Control flow issues  (UNREACHABLE)
/home/boud/dev/krita/libs/ui/input/kis_input_manager_p.cpp: 549 in KisInputManager::Private::addNativeGestureShortcut(KisAbstractInputAction *, int, KisShortcutConfiguration::GestureAction)()
543                 break;
544     #endif
545             default:
546                 return false;
547         }
548     
>>>     CID 248979:  Control flow issues  (UNREACHABLE)
>>>     This code cannot be reached: "KisNativeGestureShortcut *s...".
549         KisNativeGestureShortcut *shortcut = new KisNativeGestureShortcut(action, index, type);
550         matcher.addShortcut(shortcut);
551         return true;
552     }
553     
554     void KisInputManager::Private::setupActions()


________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u2389337.ct.sendgrid.net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRbsBCcQH3Atmwb4TYT-2FqANQ2J3wlSOCm-2B3ylNE5FNMH0Q-3D-3D_H2sGkMRRC1DUE-2Bievv2oNsjuK-2BXMiz8ix5dOOV7MqeWxkeQWaQmyEFxu-2F3jJ4WWF2MoR1zo2ltHlyNBfMPYf8qbnlEtMYFbrz-2F53JMi3QLtFAUWt7m7V-2FwYv7DgfCnxAGoz9Uiqm0Z-2BLI1VeqDSoZuyKid5FYD15jzirKpHO-2BMLW9V8cgk9-2F06OoXwepAhP1LXlPOK4uwJhbVLkPcqc7jQ-3D-3D



More information about the kimageshop mailing list