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 767645 - Unallocated memory access in OpenGlSurfacePainter
Unallocated memory access in OpenGlSurfacePainter
Status: RESOLVED WONTFIX
Product: GStreamer
Classification: Platform
Component: qt-gstreamer
git master
Other Linux
: Normal minor
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-06-14 12:02 UTC by vandeglind.jeffrey
Modified: 2018-05-04 12:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
quick fix (4.91 KB, patch)
2016-06-14 12:02 UTC, vandeglind.jeffrey
needs-work Details | Review

Description vandeglind.jeffrey 2016-06-14 12:02:41 UTC
Created attachment 329776 [details] [review]
quick fix

The Qt application on our custom embedded platform (imx6, analogue camera input - format I420) kept crashing about 50% of the time when no camera was attached. After investigation I found that only 518400 was allocated, instead of the 622080 assumed. When the camera is connected, it does indeed allocate 622080.

As I am not an expert in hardware or GStreamer, I don't know if the error is in the video driver or that indeed it is a bug that no size is given with the data pointer.

See the patch for the solution that worked for us.
Comment 1 Sebastian Dröge (slomo) 2016-06-17 09:16:37 UTC
Review of attachment 329776 [details] [review]:

In general getting the strides, offsets, etc should be done with the GstVideoInfo and/or GstVideoFrame API. That will always give you the correct values and you don't have to implement the conversions yourself.

::: elements/gstqtvideosink/delegates/qtvideosinkdelegate.cpp
@@ +108,3 @@
             GstMapInfo mem_info;
             if (gst_buffer_map(m_buffer, &mem_info, GST_MAP_READ)) {
+                m_painter->paint(mem_info.data, gst_buffer_get_size(m_buffer), m_bufferFormat,

You can use mem_info.size here
Comment 2 George Kiagiadakis 2018-05-04 12:41:56 UTC
Thanks for reporting, but sorry, this sounds wrong. If the upstream element is producing something else than what the caps say, then it should at least re-negotiate. It's true though that qtvideosink should be using GstVideoMeta to discover the stride, offset, etc, but even in that case, I don't think it's valid to produce a "raw" frame with less pixels than what the caps say.