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 654416 - [mpegtsmux] gst_buffer_unref () call segfaults
[mpegtsmux] gst_buffer_unref () call segfaults
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: 0.10.23
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-07-11 20:01 UTC by Sameer Naik
Modified: 2011-07-12 05:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[PATCH] the fix (1.05 KB, patch)
2011-07-12 03:32 UTC, Sameer Naik
committed Details | Review

Description Sameer Naik 2011-07-11 20:01:03 UTC
Upon testing my gstreamer application, i found that mpegtsmux plugin segfaults occasionally when trying to unref the buffer in the mpegtsmux_choose_best_stream () call. Specifically the line:

gst/mpegtsmux/mpegtsmux.c:646
gst_buffer_unref (gst_collect_pads_pop (mux->collect, c_best));

I found that the gst_collect_pads_pop () call returns no buffer (NULL), this results in gst_buffer_unref (NULL) to be called resulting in a segmentation fault.

Attached patch fixes the issue.

P.S. The patch is generated against the git.
Comment 1 David Schleef 2011-07-11 22:46:43 UTC
You forgot to attach the patch?
Comment 2 Sameer Naik 2011-07-12 03:32:15 UTC
Created attachment 191763 [details] [review]
[PATCH] the fix
Comment 3 Sebastian Dröge (slomo) 2011-07-12 05:52:48 UTC
commit 666807ed695be260befcba15638ef53789d9650d
Author: Sameer Naik <sameer.subscriptions@damagehead.com>
Date:   Tue Jul 12 01:18:16 2011 +0530

    mpegtsmux: fix segfault if gst_collect_pads_pop () returns no buffer
    
    In mpegtsmux_choose_best_stream () call if the gst_collect_pads_pop () call
    returns no buffer (NULL), the plugin SegFaults in the gst_buffer_unref call.
    To fix this we check if a valid buffer is returned before calling
    gst_buffer_unref ().
    
    Fixes bug #654416.