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 755748 - gst-rtsp-server: Retain reference to rtsp-media when preparing
gst-rtsp-server: Retain reference to rtsp-media when preparing
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-rtsp-server
git master
Other All
: Normal normal
: 1.6.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-09-28 16:00 UTC by Sebastian Rasmussen
Modified: 2015-09-29 12:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch. (1.46 KB, patch)
2015-09-28 16:01 UTC, Sebastian Rasmussen
committed Details | Review

Description Sebastian Rasmussen 2015-09-28 16:00:44 UTC
default_prepare() takes a transfer-none reference GstRTSPMedia object. Later on a g_idle_source_new() is created and a pointer to the media object is passed as user data. If the media is freed before the idle source is dispatched the media object pointer is invalid, but the idle source callback expects it to still be valid. To fix this a reference to the media object is taken when registering the source callback function and a corresponding release of the reference is done when the souce is destroyed.

I have seen this happen in practice but I have unfortunately lost the log.
Comment 1 Sebastian Rasmussen 2015-09-28 16:01:46 UTC
Created attachment 312315 [details] [review]
Proposed patch.
Comment 2 Tim-Philipp Müller 2015-09-29 12:02:01 UTC
commit 6f1cad9237956235e5cf326c1e6394e5ae39433a
Author: Sebastian Rasmussen <sebras@hotmail.com>
Date:   Mon Sep 28 17:40:59 2015 +0200

    rtsp-media: Take reference to media that will be prepared
    
    default_prepare() takes a transfer-none reference GstRTSPMedia object.
    Later on a g_idle_source_new() is created and a pointer to the media
    object is passed as user data. If the media is freed before the idle
    source is dispatched the media object pointer is invalid, but the idle
    source callback expects it to still be valid. To fix this a reference to
    the media object is taken when registering the source callback function
    and a corresponding release of the reference is done when the souce is
    destroyed.
    
    Fixes https://bugzilla.gnome.org/show_bug.cgi?id=755748