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 749684 - dashdemux: Segfault when playback starts after refactor for segments iteration
dashdemux: Segfault when playback starts after refactor for segments iteration
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal major
: 1.5.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-05-21 14:10 UTC by David Waring
Modified: 2015-05-25 18:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix segfault on live stream playback (10.26 KB, patch)
2015-05-21 14:10 UTC, David Waring
committed Details | Review

Description David Waring 2015-05-21 14:10:33 UTC
Created attachment 303761 [details] [review]
Fix segfault on live stream playback

Experiencing a segfaults in gstreamer when trying to playback the DASH stream at:
http://dash.bidi.int.bbc.co.uk/e/pseudolive/bbb/client_manifest.mpd

The functions causing segfaults appear to be:
gst_mpd_client_get_next_fragment_timestamp
gst_mpd_client_get_next_fragment
gst_mpd_client_has_next_segment
gst_mpd_client_advance_segment

This appears to be cases in the code where stream->segments->len is used without stream->segments being checked first. In other cases where this attribute is used there is a separate case for when the segments attribute is NULL.

This behaviour looks like it was introduced in commits 6344f86e "dashdemux: improve mpd parsing for repeated segment entries" and 2105a310 "dashdemux: refactor segment iteration for better performance"

The attached patch tries to perform similar operations as other parts introduced in the above commits to fix the functions causing the segfaults.
Comment 1 Nicolas Dufresne (ndufresne) 2015-05-21 16:01:20 UTC
Adn it seems 100% reproducable, hence ranking up a bit this bug.
Comment 2 Thiago Sousa Santos 2015-05-25 17:55:05 UTC
Thanks for the patch, merged.

ommit c4ff5359aa3642f13d7a67dd938cff1d93dc0f18
Author: David Waring <david.waring@rd.bbc.co.uk>
Date:   Wed May 20 12:08:38 2015 +0100

    dashdemux: Fix segfault introduced by segment iteration refactoring (2105a310).
    
    The functions to get the next fragment, next fragment timestamp and to advance
    to the next fragment need to work differently when stream->segments is NULL.
    Use logic similar to that introduced by commit 2105a310 to perform these
    functions.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=749684