hlsdemux: Don't double-free variant streams on errors
authorEdward Hervey <edward@centricular.com>
Wed, 11 Nov 2020 17:07:57 +0000 (18:07 +0100)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Wed, 11 Nov 2020 19:19:28 +0000 (19:19 +0000)
commita4b20ed276f4dd5e30b42336aa6fd99c018b88d4
tree48051d2d16fa0b21e3ebf680fb4313d9363df962
parent04472c5adb4042e98a2b1f80cc239abb9cbaa47e
hlsdemux: Don't double-free variant streams on errors

If an error happened switching to a new variant, we switch back to the previous
one ... except it will be unreffed when settin git.

In order to avoid such issues, keep a reference to the old variant until we're
sure we don't need it anymore

Fixes cases of double-free on variants and its contents

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1799>
ext/hls/gsthlsdemux.c