gstreamer/gst-libs/gst
Alicia Boya García 29aeba639a videodecoder: Fix racy critical when pool negotiation occurs during flush
I found a rather reproducible race in a WebKit LayoutTest when a player
was intantiated and a VP8/9 video was loaded, then torn down after
getting the video dimensions from the caps.

The crash occurs during the handling of the first frame by gstvpxdec.
The following actions happen sequentially leading to a crash.

(MT=Main Thread, ST=Streaming Thread)

MT: Sets pipeline state to NULL, which deactivates vpxdec's srcpad,
    which in turn sets its FLUSHING flag.

ST: gst_vpx_dec_handle_frame() -- which is still running -- calls
    gst_video_decoder_allocate_output_frame(); this in turn calls
    gst_video_decoder_negotiate_unlocked() which fails because the
    srcpad is FLUSHING. As a direct consequence of the negotiation
    failure, a pool is NOT set.

    gst_video_decoder_negotiate_unlocked() still assumes there is a
    pool, crashing in a critical in gst_buffer_pool_acquire_buffer()
    a couple statements later.

This patch fixes the bug by returning != GST_FLOW_OK when the
negotiation fails. If the srcpad is FLUSHING, GST_FLOW_FLUSHING is
returned, otherwise GST_FLOW_ERROR is used.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1031>
2021-02-16 16:57:54 +00:00
..
allocators fdmemory: Allow for change of protection mode 2020-10-28 17:11:05 +00:00
app appsrc: fix signal documentation 2020-12-31 17:01:40 +00:00
audio libs: audio: Fix gst_audio_buffer_truncate meta handling 2021-02-15 17:32:04 +01:00
fft Meson: Use pkg-config generator 2020-10-23 11:19:11 -04:00
gl gl/dispmanx: fix deadlock triggered by set_render_rectangle 2021-02-10 09:30:27 +01:00
pbutils encoding-profile: Plug a leak of factory list 2021-02-10 15:56:26 +00:00
riff Meson: Use pkg-config generator 2020-10-23 11:19:11 -04:00
rtp rtpbasedepayload: add auto-header-extension property 2021-02-03 11:23:40 +01:00
rtsp Meson: Use pkg-config generator 2020-10-23 11:19:11 -04:00
sdp Meson: Use pkg-config generator 2020-10-23 11:19:11 -04:00
tag tagdemux: resize and trim buffer in place to fix interaction with oggdemux 2021-01-04 14:21:43 +00:00
video videodecoder: Fix racy critical when pool negotiation occurs during flush 2021-02-16 16:57:54 +00:00
gettext.h Fix FSF address 2012-11-03 23:05:09 +00:00
glib-compat-private.h Fix FSF address 2012-11-03 23:05:09 +00:00
gst-i18n-app.h tools: add simple command-line gst-play utility for testing purposes 2013-08-16 15:45:23 +01:00
gst-i18n-plugin.h Fix FSF address 2012-11-03 23:05:09 +00:00
meson.build meson: Add feature options for all plugins 2018-07-27 18:42:11 +05:30