[vlc-devel] [PATCH 1/2] cvpx: fix error case in Open
Alexandre Janniaux
ajanni at videolabs.io
Tue Jul 28 13:54:02 CEST 2020
As the code was returning `ret` but didn't set it before jumping to the
error: label. In case of error, p_sys wasn't NULL too, which could lead
to failure in other filters.
---
modules/video_chroma/cvpx.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/modules/video_chroma/cvpx.c b/modules/video_chroma/cvpx.c
index 00736d8ea0..147d064ff7 100644
--- a/modules/video_chroma/cvpx.c
+++ b/modules/video_chroma/cvpx.c
@@ -361,7 +361,8 @@ static int Open(vlc_object_t *obj)
return VLC_SUCCESS;
error:
Close(obj);
- return ret;
+ p_filter->p_sys = NULL;
+ return ret == VLC_SUCCESS ? VLC_EGENERIC : ret;
#undef CASE_CVPX_INPUT
#undef CASE_CVPX_OUTPUT
}
--
2.27.0
More information about the vlc-devel
mailing list