GNOME Bugzilla – Bug 788162
graphicsvideosurface : Check if d is NULL before using it, in Constructor GraphicsVideoSurface
Last modified: 2017-09-26 08:56:35 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.
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.