After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 788162 - graphicsvideosurface : Check if d is NULL before using it, in Constructor GraphicsVideoSurface
graphicsvideosurface : Check if d is NULL before using it, in Constructor Gra...
Status: RESOLVED NOTABUG
Product: GStreamer
Classification: Platform
Component: qt-gstreamer
1.13.x
Other All
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-09-26 04:29 UTC by Renu
Modified: 2017-09-26 08:56 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Renu 2017-09-26 04:29:30 UTC
Hi

I found the problem in this code.

GraphicsVideoSurface::GraphicsVideoSurface(QGraphicsView *parent)
    : QObject(parent), d(new GraphicsVideoSurfacePrivate)
{
    d->view = parent;
}

we should check d for NULL check, before Using it.

Solution:

GraphicsVideoSurface::GraphicsVideoSurface(QGraphicsView *parent)
    : QObject(parent), d(new GraphicsVideoSurfacePrivate)
{
    if(d)
       d->view = parent;
}

Please review and share your feedback.
Comment 1 George Kiagiadakis 2017-09-26 08:56:35 UTC
d cannot possibly be NULL in this context, as it is initialized in the constructor parameters right above: d(new GraphicsVideoSurfacePrivate)

If this fails, it means you are out of memory... in which case, well, there is not much you can do.