hlsdemux: Don't double-free variant streams on errors 23/262823/1 accepted/tizen/unified/20210824.123802 submit/tizen/20210823.074442
authorEdward Hervey <edward@centricular.com>
Wed, 11 Nov 2020 17:07:57 +0000 (18:07 +0100)
committerGilbok Lee <gilbok.lee@samsung.com>
Fri, 20 Aug 2021 06:48:39 +0000 (15:48 +0900)
commit16e25e51fecfbd2f120823066dfabcc3f46bc647
tree701037328f38c0c237aacadb56c170dd6f72a1bb
parent57873655c68f4f9d052f6307f09ba5931d892915
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

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