New Defects reported by Coverity Scan for digiKam

scan-admin at coverity.com scan-admin at coverity.com
Fri May 13 15:20:52 BST 2022


Hi,

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

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


** CID 1504427:  Control flow issues  (UNREACHABLE)
/home/gilles/Devel/8.x/core/avplayer/main/main.cpp: 91 in rendererId_from_opt_name(const QString &)()


________________________________________________________________________________________________________
*** CID 1504427:  Control flow issues  (UNREACHABLE)
/home/gilles/Devel/8.x/core/avplayer/main/main.cpp: 91 in rendererId_from_opt_name(const QString &)()
85     #   endif
86     
87         return VideoRendererId_GLWidget2;
88     
89     #endif
90     
>>>     CID 1504427:  Control flow issues  (UNREACHABLE)
>>>     This code cannot be reached: "return QtAV::VideoRendererI...".
91         return VideoRendererId_Widget;
92     }
93     
94     int main(int argc, char* argv[])
95     {
96         KLocalizedString::setApplicationDomain("digikam");

** CID 1504426:    (UNINIT_CTOR)
/home/gilles/Devel/8.x/core/libs/video/qtav/widgets/X11/X11Renderer.cpp: 305 in QtAV::X11RendererPrivate::X11RendererPrivate()()
/home/gilles/Devel/8.x/core/libs/video/qtav/widgets/X11/X11Renderer.cpp: 245 in QtAV::X11RendererPrivate::X11RendererPrivate()()
/home/gilles/Devel/8.x/core/libs/video/qtav/widgets/X11/X11Renderer.cpp: 257 in QtAV::X11RendererPrivate::X11RendererPrivate()()
/home/gilles/Devel/8.x/core/libs/video/qtav/widgets/X11/X11Renderer.cpp: 305 in QtAV::X11RendererPrivate::X11RendererPrivate()()


________________________________________________________________________________________________________
*** CID 1504426:    (UNINIT_CTOR)
/home/gilles/Devel/8.x/core/libs/video/qtav/widgets/X11/X11Renderer.cpp: 305 in QtAV::X11RendererPrivate::X11RendererPrivate()()
299                     ximage_depth = 15;
300                 else if (mask == 0xFFFF)
301                     ximage_depth = 16;
302             }
303     
304             Q_UNUSED(ximage_depth);
>>>     CID 1504426:    (UNINIT_CTOR)
>>>     Non-static class member "shm_pool.readOnly" is not initialized in this constructor nor in any functions that it calls.
305         }
306     
307         ~X11RendererPrivate()
308         {
309             for (int i = 0 ; i < kPoolSize ; ++i)
310                 destroyX11Image(i);
/home/gilles/Devel/8.x/core/libs/video/qtav/widgets/X11/X11Renderer.cpp: 245 in QtAV::X11RendererPrivate::X11RendererPrivate()()
239     
240             if (!display)
241             {
242                 available = false;
243                 qCWarning(DIGIKAM_QTAVWIDGETS_LOG_WARN).noquote() << QString::asprintf("Open X11 display error");
244     
>>>     CID 1504426:    (UNINIT_CTOR)
>>>     Non-static class member "shm_pool.readOnly" is not initialized in this constructor nor in any functions that it calls.
245                 return;
246             }
247     
248             XWindowAttributes attribs;
249             XGetWindowAttributes(display, DefaultRootWindow(display), &attribs);
250             depth = attribs.depth;
/home/gilles/Devel/8.x/core/libs/video/qtav/widgets/X11/X11Renderer.cpp: 257 in QtAV::X11RendererPrivate::X11RendererPrivate()()
251     
252             if (!XMatchVisualInfo(display, DefaultScreen(display), depth, TrueColor, &vinfo))
253             {
254                 qCWarning(DIGIKAM_QTAVWIDGETS_LOG_WARN).noquote() << QString::asprintf("XMatchVisualInfo error");
255                 available = false;
256     
>>>     CID 1504426:    (UNINIT_CTOR)
>>>     Non-static class member "shm_pool.readOnly" is not initialized in this constructor nor in any functions that it calls.
257                 return;
258             }
259     
260             XImage *ximg = nullptr;
261     
262             if (depth != 15 && depth != 16 && depth != 24 && depth != 32)
/home/gilles/Devel/8.x/core/libs/video/qtav/widgets/X11/X11Renderer.cpp: 305 in QtAV::X11RendererPrivate::X11RendererPrivate()()
299                     ximage_depth = 15;
300                 else if (mask == 0xFFFF)
301                     ximage_depth = 16;
302             }
303     
304             Q_UNUSED(ximage_depth);
>>>     CID 1504426:    (UNINIT_CTOR)
>>>     Non-static class member "shm_pool.readOnly" is not initialized in this constructor nor in any functions that it calls.
305         }
306     
307         ~X11RendererPrivate()
308         {
309             for (int i = 0 ; i < kPoolSize ; ++i)
310                 destroyX11Image(i);

** CID 1504425:  Integer handling issues  (OVERFLOW_BEFORE_WIDEN)
/home/gilles/Devel/8.x/core/libs/video/qtav/examples/simpleplayer/playerwindow.cpp: 108 in PlayerWindow::seekBySlider(int)()


________________________________________________________________________________________________________
*** CID 1504425:  Integer handling issues  (OVERFLOW_BEFORE_WIDEN)
/home/gilles/Devel/8.x/core/libs/video/qtav/examples/simpleplayer/playerwindow.cpp: 108 in PlayerWindow::seekBySlider(int)()
102     
103     void PlayerWindow::seekBySlider(int value)
104     {
105         if (!m_player->isPlaying())
106             return;
107     
>>>     CID 1504425:  Integer handling issues  (OVERFLOW_BEFORE_WIDEN)
>>>     Potentially overflowing expression "value * this->m_unit" with type "int" (32 bits, signed) is evaluated using 32-bit arithmetic, and then used in a context that expects an expression of type "qint64" (64 bits, signed).
108         m_player->seek(qint64(value*m_unit));
109     }
110     
111     void PlayerWindow::seekBySlider()
112     {
113         seekBySlider(m_slider->value());

** CID 1504424:    (UNINIT_CTOR)
/home/gilles/Devel/8.x/core/libs/video/qtav/widgets/X11/XVRenderer.cpp: 251 in QtAV::XVRendererPrivate::XVRendererPrivate()()
/home/gilles/Devel/8.x/core/libs/video/qtav/widgets/X11/XVRenderer.cpp: 241 in QtAV::XVRendererPrivate::XVRendererPrivate()()
/home/gilles/Devel/8.x/core/libs/video/qtav/widgets/X11/XVRenderer.cpp: 249 in QtAV::XVRendererPrivate::XVRendererPrivate()()


________________________________________________________________________________________________________
*** CID 1504424:    (UNINIT_CTOR)
/home/gilles/Devel/8.x/core/libs/video/qtav/widgets/X11/XVRenderer.cpp: 251 in QtAV::XVRendererPrivate::XVRendererPrivate()()
245             {
246                 available = false;
247                 qCCritical(DIGIKAM_QTAVWIDGETS_LOG_CRITICAL) << QString::asprintf("No adaptor found!");
248     
249                 return;
250             }
>>>     CID 1504424:    (UNINIT_CTOR)
>>>     Non-static class member "shm.readOnly" is not initialized in this constructor nor in any functions that it calls.
251         }
252     
253         ~XVRendererPrivate()
254         {
255             if (xv_adaptor_info)
256             {
/home/gilles/Devel/8.x/core/libs/video/qtav/widgets/X11/XVRenderer.cpp: 241 in QtAV::XVRendererPrivate::XVRendererPrivate()()
235     
236             if (XvQueryAdaptors(display, DefaultRootWindow(display), &num_adaptors, &xv_adaptor_info) != Success)
237             {
238                 available = false;
239                 qCCritical(DIGIKAM_QTAVWIDGETS_LOG_CRITICAL) << QString::asprintf("Query adaptors failed!");
240     
>>>     CID 1504424:    (UNINIT_CTOR)
>>>     Non-static class member "shm.readOnly" is not initialized in this constructor nor in any functions that it calls.
241                 return;
242             }
243     
244             if (num_adaptors < 1)
245             {
246                 available = false;
/home/gilles/Devel/8.x/core/libs/video/qtav/widgets/X11/XVRenderer.cpp: 249 in QtAV::XVRendererPrivate::XVRendererPrivate()()
243     
244             if (num_adaptors < 1)
245             {
246                 available = false;
247                 qCCritical(DIGIKAM_QTAVWIDGETS_LOG_CRITICAL) << QString::asprintf("No adaptor found!");
248     
>>>     CID 1504424:    (UNINIT_CTOR)
>>>     Non-static class member "shm.readOnly" is not initialized in this constructor nor in any functions that it calls.
249                 return;
250             }
251         }
252     
253         ~XVRendererPrivate()
254         {

** CID 1504423:  Uninitialized members  (UNINIT_CTOR)
/home/gilles/Devel/8.x/core/libs/video/qtav/examples/videowall/VideoWall.cpp: 72 in VideoWall::VideoWall(QObject *)()


________________________________________________________________________________________________________
*** CID 1504423:  Uninitialized members  (UNINIT_CTOR)
/home/gilles/Devel/8.x/core/libs/video/qtav/examples/videowall/VideoWall.cpp: 72 in VideoWall::VideoWall(QObject *)()
66             view->resize(qApp->desktop()->size());
67             view->move(QPoint(0, 0));
68             view->show();
69         }
70     
71         view->installEventFilter(this);
>>>     CID 1504423:  Uninitialized members  (UNINIT_CTOR)
>>>     Non-static class member "timer_id" is not initialized in this constructor nor in any functions that it calls.
72     }
73     
74     VideoWall::~VideoWall()
75     {
76         if (menu)
77         {

** CID 1504422:  Incorrect expression  (UNINTENDED_INTEGER_DIVISION)
/home/gilles/Devel/8.x/core/avplayer/main/MainWindow.cpp: 1434 in AVPlayer::MainWindow::wheelEvent(QWheelEvent *)()


________________________________________________________________________________________________________
*** CID 1504422:  Incorrect expression  (UNINTENDED_INTEGER_DIVISION)
/home/gilles/Devel/8.x/core/avplayer/main/MainWindow.cpp: 1434 in AVPlayer::MainWindow::wheelEvent(QWheelEvent *)()
1428         }
1429     
1430         QPoint dp;
1431     
1432     #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
1433     
>>>     CID 1504422:  Incorrect expression  (UNINTENDED_INTEGER_DIVISION)
>>>     Dividing integer expressions "e->angleDelta().y()" and "8", and then converting the integer quotient to type "double". Any remainder, or fractional part of the quotient, is ignored.
1434         qreal deg = e->angleDelta().y() / 8;
1435         dp        = e->pixelDelta();
1436     
1437     #else
1438     
1439         qreal deg = e->delta() / 8;

** CID 1504421:  Incorrect expression  (COPY_PASTE_ERROR)
/home/gilles/Devel/8.x/core/libs/video/qtav/src/output/video/VideoRenderer.cpp: 571 in QtAV::VideoRenderer::normalizedROI() const()


________________________________________________________________________________________________________
*** CID 1504421:  Incorrect expression  (COPY_PASTE_ERROR)
/home/gilles/Devel/8.x/core/libs/video/qtav/src/output/video/VideoRenderer.cpp: 571 in QtAV::VideoRenderer::normalizedROI() const()
565     
566         if ((r.width() > 1) || (!normalized && r.width() == 1))
567         {
568             r.setWidth(r.width() / qreal(d.src_width));
569         }
570     
>>>     CID 1504421:  Incorrect expression  (COPY_PASTE_ERROR)
>>>     "width" in "r.width()" looks like a copy-paste error.
571         if ((r.height() > 1) || (!normalized && r.width() == 1))
572         {
573             r.setHeight(r.height() / qreal(d.src_height));
574         }
575     
576         return r;

** CID 1504420:  Uninitialized members  (UNINIT_CTOR)
/home/gilles/Devel/8.x/core/libs/video/qtav/widgets/config/DecoderConfigPage.cpp: 310 in QtAV::DecoderConfigPage::DecoderConfigPage(QWidget *, bool)()


________________________________________________________________________________________________________
*** CID 1504420:  Uninitialized members  (UNINIT_CTOR)
/home/gilles/Devel/8.x/core/libs/video/qtav/widgets/config/DecoderConfigPage.cpp: 310 in QtAV::DecoderConfigPage::DecoderConfigPage(QWidget *, bool)()
304         vlsroll->addLayout(vb);
305         scrollArea->setWidget(scrollAreaWidgetContents);
306         vbs->addWidget(scrollArea);
307     
308         connect(&AVPlayerConfigMngr::instance(), SIGNAL(decoderPriorityNamesChanged()),
309                 this, SLOT(onConfigChanged()));
>>>     CID 1504420:  Uninitialized members  (UNINIT_CTOR)
>>>     Non-static class member "mpThreads" is not initialized in this constructor nor in any functions that it calls.
310     }
311     
312     QString DecoderConfigPage::name() const
313     {
314         return i18nc("@title", "Decoder");
315     }

** CID 1504419:  Uninitialized members  (UNINIT_CTOR)
/home/gilles/Devel/8.x/core/libs/video/qtav/examples/videogroup/videogroup.cpp: 120 in VideoGroup::VideoGroup(QObject *)()


________________________________________________________________________________________________________
*** CID 1504419:  Uninitialized members  (UNINIT_CTOR)
/home/gilles/Devel/8.x/core/libs/video/qtav/examples/videogroup/videogroup.cpp: 120 in VideoGroup::VideoGroup(QObject *)()
114         mpBar->layout()->addWidget(mp1Window);
115         mpBar->layout()->addWidget(mp1Frame);
116     
117         //mpBar->layout()->addWidget(mpFrameless);
118     
119         mpBar->resize(200, 25);
>>>     CID 1504419:  Uninitialized members  (UNINIT_CTOR)
>>>     Non-static class member "timer_id" is not initialized in this constructor nor in any functions that it calls.
120     }
121     
122     VideoGroup::~VideoGroup()
123     {
124         delete view;
125         delete mpBar;

** CID 1504418:    (UNINIT_CTOR)
/home/gilles/Devel/8.x/core/libs/video/qtav/examples/simpleplayer/playerwindow.cpp: 50 in PlayerWindow::PlayerWindow(QWidget *)()
/home/gilles/Devel/8.x/core/libs/video/qtav/examples/videocapture/playerwindow.cpp: 55 in PlayerWindow::PlayerWindow(QWidget *)()


________________________________________________________________________________________________________
*** CID 1504418:    (UNINIT_CTOR)
/home/gilles/Devel/8.x/core/libs/video/qtav/examples/simpleplayer/playerwindow.cpp: 50 in PlayerWindow::PlayerWindow(QWidget *)()
44         m_vo            = new VideoOutput(this);
45     
46         if (!m_vo->widget())
47         {
48             QMessageBox::warning(0, QString::fromLatin1("QtAV error"), tr("Can not create video renderer"));
49     
>>>     CID 1504418:    (UNINIT_CTOR)
>>>     Non-static class member "m_stopBtn" is not initialized in this constructor nor in any functions that it calls.
50             return;
51         }
52     
53         m_player->setRenderer(m_vo);
54         vl->addWidget(m_vo->widget());
55         m_slider = new QSlider();
/home/gilles/Devel/8.x/core/libs/video/qtav/examples/videocapture/playerwindow.cpp: 55 in PlayerWindow::PlayerWindow(QWidget *)()
49         m_vo = new VideoOutput(this);
50     
51         if (!m_vo->widget())
52         {
53             QMessageBox::warning(0, QString::fromLatin1("QtAV error"), QString::fromLatin1("Can not create video renderer"));
54     
>>>     CID 1504418:    (UNINIT_CTOR)
>>>     Non-static class member "m_preview" is not initialized in this constructor nor in any functions that it calls.
55             return;
56         }
57     
58         m_player->setRenderer(m_vo);
59         vl->addWidget(m_vo->widget());
60         m_slider = new QSlider();

** CID 1504152:  Uninitialized members  (UNINIT_CTOR)
/home/gilles/Devel/8.x/core/libs/video/qtav/src/ffmpeg/VideoThread.cpp: 59 in QtAV::VideoThreadPrivate::VideoThreadPrivate()()


________________________________________________________________________________________________________
*** CID 1504152:  Uninitialized members  (UNINIT_CTOR)
/home/gilles/Devel/8.x/core/libs/video/qtav/src/ffmpeg/VideoThread.cpp: 59 in QtAV::VideoThreadPrivate::VideoThreadPrivate()()
53             AVThreadPrivate()
54           , force_fps(0)
55           , force_dt(0)
56           , capture(nullptr)
57           , filter_context(nullptr)
58         {
>>>     CID 1504152:  Uninitialized members  (UNINIT_CTOR)
>>>     Non-static class member "pts" is not initialized in this constructor nor in any functions that it calls.
59         }
60     
61         ~VideoThreadPrivate()
62         {
63             // not necessary context is managed by filters.
64     


________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50yp2OAl-2Fauo86CB28HCT0-2BnD-2F6eFMYt863B1-2B0FLvU5y-2FRWSl8rMA4vGwCkGPp0f1hg-3DKUfr_IpEMwFcbl-2BY9RHaL2m6a3nuAxB4hfm4MTniX0gHjADXdWXj4s-2F3FSvPw0OkQLiGD9Flpb13PhL9jMu8d8V-2BqLsg7igK0bS8E4PpImvpd1G5Gq1mGsh5zohVONj-2Bi1-2BlRgIGISyoKcrgc-2B3G11nM2xo2O7WVr9T6xtgAyXXnLhcpjKFAqcgRwQVCKCbeI-2FE-2Fg8noCqipsrO8SjA-2BKJP4zwBnwojRwkbRYDJeUrPY6NmM-3D



More information about the Digikam-devel mailing list