wavparse: Avoid occasional crash due to referencing freed buffer.
authorDevin Anderson <danderson@microsoft.com>
Fri, 14 Oct 2022 01:23:04 +0000 (01:23 +0000)
committerDevin Anderson <danderson@microsoft.com>
Fri, 14 Oct 2022 07:54:03 +0000 (07:54 +0000)
commit31b244271ea9160a9f07cede00674750a2ac4dca
tree586ee6c6fb353d60735f9991c16bc1144829c650
parentae8a5e110cb9dc522bb4fad743daa54c8c4cb055
wavparse: Avoid occasional crash due to referencing freed buffer.

We've seen occasional crashes in the `wavparse` module associated with
referencing a buffer in `gst_wavparse_chain` that's already been freed.  The
reference is stolen when the buffer is transferred to the adapter with
`gst_adapter_push` and, IIUC, assuming the source doesn't hold a reference to
the buffer, the buffer could be freed during interaction with the adapter in
`gst_wavparse_stream_headers`.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3179>
subprojects/gst-plugins-good/gst/wavparse/gstwavparse.c