diff --git a/modules/videoio/src/cap_gstreamer.cpp b/modules/videoio/src/cap_gstreamer.cpp index 23d39d247a..95ff159cc3 100644 --- a/modules/videoio/src/cap_gstreamer.cpp +++ b/modules/videoio/src/cap_gstreamer.cpp @@ -1811,6 +1811,10 @@ void handleMessage(GstElement * pipeline) while(gst_bus_have_pending(bus)) { msg = gst_bus_pop(bus); + if (!msg || !GST_IS_MESSAGE(msg)) + { + continue; + } //printf("\t\tGot %s message\n", GST_MESSAGE_TYPE_NAME(msg));