• Vincent Penquerc'h's avatar
    alsasink: fix occasional crash intersecting invalid values · 3b2d5833
    Vincent Penquerc'h authored
    When a pipeline using alsasink and push mode upstream fails
    to preroll, the following state will be the case:
    - A loop upstream will be PAUSED, pushing a first buffer
    - alsasink will be READY, pending PAUSED, because async
    
    On error, the pipeline will switch to NULL. alsasink is in
    READY, so goes to NULL immediately. It zeroes its cached
    caps. Meanwhile, the upstream loop can cause a caps query,
    conccurent with the state change. This will use those cached
    caps. If the zeroing happens between the NULL test and the
    dereferencing, GStreamer will critical down in the GstValue
    code.
    
    Since it appears that such a gap between states (PAUSED
    and pushing upstream, and NULL downstream) is expected, we
    need to protect the read/write access to the cached caps.
    
    This fixes the critical.
    
    See https://bugzilla.gnome.org/show_bug.cgi?id=731121
    3b2d5833
gstalsasink.c 34 KB