From a03fdfd9c1dc2cc99b30868de93c3eacd60cc478 Mon Sep 17 00:00:00 2001 From: Alexandre Janniaux Date: Mon, 12 Dec 2022 14:39:21 +0100 Subject: [PATCH] codec: qsv: move enc->p_sys assignment down Ensure that the p_enc->p_sys value is not set on error by moving it down. --- modules/codec/qsv.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/modules/codec/qsv.c b/modules/codec/qsv.c index 0c7062ecf0..48ec14df7f 100644 --- a/modules/codec/qsv.c +++ b/modules/codec/qsv.c @@ -432,8 +432,6 @@ static int Open(vlc_object_t *this) return VLC_EGENERIC; } - enc->p_sys = sys; - vlc_list_init(&sys->packets); config_ChainParse(enc, SOUT_CFG_PREFIX, sout_options, enc->p_cfg); @@ -625,16 +623,15 @@ static int Open(vlc_object_t *this) .encode_video = Encode, }; enc->ops = &ops; + enc->p_sys = sys; return VLC_SUCCESS; error: Close(enc); - enc->p_sys = NULL; return VLC_EGENERIC; nomem: Close(enc); - enc->p_sys = NULL; return VLC_ENOMEM; }