v4l2codecs: Fix segfault when destroying non-detached allocator
authorJames Cowgill <james.cowgill@blaize.com>
Wed, 20 Oct 2021 11:08:49 +0000 (12:08 +0100)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Tue, 2 Nov 2021 15:25:48 +0000 (15:25 +0000)
commit3846b0563af1ae40c2e38a205fbef43c01d706f6
treee38613769753e4720bf39f89dcdad9215aa75592
parent1aab0e49f61593dfa7b5907ff73f837fee1007c4
v4l2codecs: Fix segfault when destroying non-detached allocator

The GstV4l2CodecAllocator dispose function clears `self->decoder` but
the finalize function then tries to use it if the allocator has no been
detached yet.

Fix by detaching in the dispose function before we clear
`self->decoder`.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1220>
subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2codecallocator.c