Repository navigation
videoio: gst: Fix gst assertion on null msg - #13988
Conversation
|
FWIW I'm still not quite sure what exactly is causing this issue - or why no one else appears to be hitting it. I have an application that reads frames from a video file using VideoCapture. OpenCV is compiled with the Gstreamer backend enabled and I am also using gstreamer-vaapi plugins. After some time (sometimes ~3h, sometimes ~10m) the application crashes because "gst_is_missing_plugin_message" asserts on the (invalid) message object pointer. My application builds against OpenCV 3.4, not the master branch. |
|
Thank you! As a "bugfix" this patch should go into 3.4 branch first. We will merge changes from 3.4 into master regularly (weekly/bi-weekly). So, please:
Note: no needs to re-open PR, apply changes "inplace". |
According to the gstreamer docs [1], the GstMessage pointer returned by gst_bus_pop() is nullable, meaning NULL is a valid return value. Previously, gst_is_missing_plugin_message would throw an assert when its message object parameter would fail the GST_IS_MESSAGE macro check, crashing the entire process (unless running in a try-catch block of course). Instead of relying on valid messages, check if the message object itself is valid before passing it to other gstreamer functions. [1] https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstBus.html#gst-bus-pop Signed-off-by: Christopher N. Hesse <[email protected]>
According to the gstreamer docs [1], the GstMessage pointer returned by
gst_bus_pop() is nullable, meaning NULL is a valid return value.
Previously, gst_is_missing_plugin_message would throw an assert when its
message object parameter would fail the GST_IS_MESSAGE macro check,
crashing the entire process (unless running in a try-catch block of course).
Instead of relying on valid messages, check if the message object itself is
valid before passing it to other gstreamer functions.
[1] https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstBus.html#gst-bus-pop
Signed-off-by: Christopher N. Hesse [email protected]
This pullrequest changes