Commit a429fb97 authored by VaL Doroshchuk's avatar VaL Doroshchuk
Browse files

Gstreamer: Fix leak in prepare-window-handle message


If the handler returns GST_BUS_DROP, it should unref the message,
else the message should not be unreffed by the sync handler.

The message is not going to be unreffed after handler call is made.

Task-number: QTBUG-64142
Change-Id: Ib44f574e95457cdfab66b390c691a8b572987d66
Reviewed-by: default avatarChristian Stromme <christian.stromme@qt.io>
parent 44b3628c
No related merge requests found
Showing with 3 additions and 1 deletion
...@@ -143,8 +143,10 @@ static GstBusSyncReply syncGstBusFilter(GstBus* bus, GstMessage* message, QGstre ...@@ -143,8 +143,10 @@ static GstBusSyncReply syncGstBusFilter(GstBus* bus, GstMessage* message, QGstre
QMutexLocker lock(&d->filterMutex); QMutexLocker lock(&d->filterMutex);
for (QGstreamerSyncMessageFilter *filter : qAsConst(d->syncFilters)) { for (QGstreamerSyncMessageFilter *filter : qAsConst(d->syncFilters)) {
if (filter->processSyncMessage(QGstreamerMessage(message))) if (filter->processSyncMessage(QGstreamerMessage(message))) {
gst_message_unref(message);
return GST_BUS_DROP; return GST_BUS_DROP;
}
} }
return GST_BUS_PASS; return GST_BUS_PASS;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment