gstreamer/gst-libs/gst/video
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
..
colorbalance.c docs: Convert gtkdoc comments to markdown 2017-03-10 18:19:17 -03:00
colorbalance.h video: GST_EXPORT -> GST_VIDEO_API 2018-03-13 12:16:42 +00:00
colorbalancechannel.c docs: Convert gtkdoc comments to markdown 2017-03-10 18:19:17 -03:00
colorbalancechannel.h Use G_DEFINE_AUTOPTR_CLEANUP_FUNC unconditionally 2019-06-04 20:31:09 -04:00
convertframe.c Pass the code through codespell 2019-08-30 13:05:36 +00:00
gstvideoaffinetransformationmeta.c Added GI annotation for gstvideoaffinetransformationmeta apply_matrix 2019-06-02 16:42:57 +00:00
gstvideoaffinetransformationmeta.h video: GST_EXPORT -> GST_VIDEO_API 2018-03-13 12:16:42 +00:00
gstvideoaggregator.c videoaggregator: Pop out old buffers on timeout 2020-12-30 16:03:13 +01:00
gstvideoaggregator.h *aggregator: Add g_autoptr support for *ConvertPad 2020-03-16 15:47:58 +00:00
gstvideodecoder.c videodecoder: Fix racy critical when pool negotiation occurs during flush 2021-02-16 16:57:54 +00:00
gstvideodecoder.h video: fix doc warning 2020-11-09 11:55:57 +00:00
gstvideoencoder.c video: Make use of gst_video_chroma_site_{from,to}_string() API 2020-12-08 07:21:28 +00:00
gstvideoencoder.h videoencoder: Add min-force-key-unit-interval property 2020-06-05 10:04:43 +00:00
gstvideofilter.c audio: video: Fix in/outbuf confusion of transform_meta 2020-10-08 18:30:39 +02:00
gstvideofilter.h Use G_DEFINE_AUTOPTR_CLEANUP_FUNC unconditionally 2019-06-04 20:31:09 -04:00
gstvideometa.c videometa: gir annotate the size of plane array in new API 2020-12-01 09:50:27 +01:00
gstvideometa.h videometa: Fix documentation 2020-06-24 02:02:50 +09:00
gstvideopool.c gl,video: Make ptrs to VideoInfo and (GL)AllocationParams immutable 2021-01-14 11:53:10 +00:00
gstvideopool.h gl,video: Make ptrs to VideoInfo and (GL)AllocationParams immutable 2021-01-14 11:53:10 +00:00
gstvideosink.c videosink: Add new GstVideoSink::set_info() virtual method 2021-01-14 11:15:40 +00:00
gstvideosink.h videosink: Add new GstVideoSink::set_info() virtual method 2021-01-14 11:15:40 +00:00
gstvideotimecode.c videotimecode: Mark latest_daily_jame as allow-none in init\() 2019-05-03 09:58:04 -04:00
gstvideotimecode.h videotimecode: Add API for initializing from a GDateTime with validation 2018-12-19 23:11:24 +00:00
gstvideoutils.c video:doc: Remove duplicated gstvideoutils SECTION 2019-05-13 17:00:00 -04:00
gstvideoutils.h videodecoder: Add API for marking output frames as corrupted 2020-09-10 17:22:14 +00:00
gstvideoutilsprivate.c videoutilsprivate: fill more video fields. 2017-08-14 12:42:57 +02:00
gstvideoutilsprivate.h videoencoder/decoder: Move conversion utility functions to a common header and use consistently in encoder/decoder 2016-07-04 10:47:36 +02:00
meson.build Meson: Use pkg-config generator 2020-10-23 11:19:11 -04:00
navigation.c navigation: Use G_DEFINE_INTERFACE 2020-03-20 06:20:43 +00:00
navigation.h navigation: Add since tag for new API 2020-04-30 18:00:19 +01:00
TODO Pass the code through codespell 2019-08-30 13:05:36 +00:00
video-anc.c meson: update glib minimum version to 2.56 2020-10-15 18:20:37 +02:00
video-anc.h video-anc: Fix gst_buffer_get_video_(afd|bar)_meta 2020-07-01 19:40:28 +00:00
video-blend.c video-blend: fix blending 8-bit and 16-bit frames together 2021-01-08 08:04:55 +00:00
video-blend.h video: GST_EXPORT -> GST_VIDEO_API 2018-03-13 12:16:42 +00:00
video-chroma.c video-chroma: Add support for any combination of chroma-site flags 2020-12-08 07:21:28 +00:00
video-chroma.h video-chroma: Add support for any combination of chroma-site flags 2020-12-08 07:21:28 +00:00
video-color.c video: Provide "deprecated in" version for gst_video_color_transfer fns 2020-11-25 20:19:39 +01:00
video-color.h video: Rename video_color_transfer to video_transfer_function 2020-09-12 09:46:44 +03:00
video-converter.c videoconvert: Support for alternate-field interlacing 2021-02-04 18:22:07 +02:00
video-converter.h gl,video: Make ptrs to VideoInfo and (GL)AllocationParams immutable 2021-01-14 11:53:10 +00:00
video-dither.c Pass the code through codespell 2019-08-30 13:05:36 +00:00
video-dither.h video: GST_EXPORT -> GST_VIDEO_API 2018-03-13 12:16:42 +00:00
video-event.c gst-libs: include config.h in all source files 2018-08-13 09:23:34 +01:00
video-event.h video: GST_EXPORT -> GST_VIDEO_API 2018-03-13 12:16:42 +00:00
video-format.c video: Add support for linear 32x32 NV12 tiles 2020-07-14 21:43:56 -04:00
video-format.h video: Add support for linear 32x32 NV12 tiles 2020-07-14 21:43:56 -04:00
video-frame.c gl,video: Make ptrs to VideoInfo and (GL)AllocationParams immutable 2021-01-14 11:53:10 +00:00
video-frame.h gl,video: Make ptrs to VideoInfo and (GL)AllocationParams immutable 2021-01-14 11:53:10 +00:00
video-hdr.c video-hdr: Add API to check content light level equality 2021-01-28 20:55:38 +01:00
video-hdr.h video-hdr: Add API to check content light level equality 2021-01-28 20:55:38 +01:00
video-info.c gl,video: Make ptrs to VideoInfo and (GL)AllocationParams immutable 2021-01-14 11:53:10 +00:00
video-info.h gl,video: Make ptrs to VideoInfo and (GL)AllocationParams immutable 2021-01-14 11:53:10 +00:00
video-multiview.c libs: Documentation cleanup 2018-04-02 08:53:28 +02:00
video-multiview.h doc: Add a minimal GstVideoMultiviewFlagsSet documentation 2020-06-03 22:44:24 -04:00
video-orc-dist.c video: update orc generated files for new functions 2019-03-21 23:05:09 +00:00
video-orc-dist.h video: update orc generated files for new functions 2019-03-21 23:05:09 +00:00
video-orc.orc video: add VUYA pixel format 2019-03-21 23:05:09 +00:00
video-overlay-composition.c gl,video: Make ptrs to VideoInfo and (GL)AllocationParams immutable 2021-01-14 11:53:10 +00:00
video-overlay-composition.h video-blend: Add support for blending on top of 16 bit per component formats 2020-03-27 08:55:45 +00:00
video-prelude.h video: Add deprecation macros 2018-12-19 23:11:24 +00:00
video-resampler.c docs: Convert gtkdoc comments to markdown 2017-03-10 18:19:17 -03:00
video-resampler.h libs: Fix various Since markers 2019-04-23 12:28:26 +00:00
video-scaler.c video-scaler: Ensure we're always using the correct lines for scaling in gst_video_scaler_2d() 2019-11-03 10:46:43 +01:00
video-scaler.h doc: Fix some gtk-doc comments 2019-05-13 11:34:08 -04:00
video-tile.c video: Add NV12_4L4 tile format 2020-07-14 17:33:31 +00:00
video-tile.h video: Add NV12_4L4 tile format 2020-07-14 17:33:31 +00:00
video.c video: Fix/Add section documentation 2018-04-02 16:49:19 +02:00
video.h video: Add new APIs for HDR information representation 2019-04-30 15:45:44 +00:00
videodirection.c docs: Convert gtkdoc comments to markdown 2017-03-10 18:19:17 -03:00
videodirection.h video: GST_EXPORT -> GST_VIDEO_API 2018-03-13 12:16:42 +00:00
videoorientation.c video: fix some GIR annotations 2018-04-23 19:33:19 +02:00
videoorientation.h video: GST_EXPORT -> GST_VIDEO_API 2018-03-13 12:16:42 +00:00
videooverlay.c videooverlay: chevrons don't need to be escaped in code examples 2020-06-11 22:19:09 +00:00
videooverlay.h libs: Documentation cleanup 2018-04-02 08:53:28 +02:00