From 61c9cbe24f6830cd745469e089470022e8a1892a Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Mon, 13 Feb 2023 14:06:36 +0100 Subject: [PATCH] goom: initialize the video format with video_format_Init() Do not rely on calloc to get proper values. --- modules/visualization/goom.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/visualization/goom.c b/modules/visualization/goom.c index 835a002b13..a7e3f474ad 100644 --- a/modules/visualization/goom.c +++ b/modules/visualization/goom.c @@ -125,9 +125,9 @@ static int Open( vlc_object_t *p_this ) const int width = var_InheritInteger( p_filter, "goom-width" ); const int height = var_InheritInteger( p_filter, "goom-height" ); + video_format_Init(&p_thread->fmt, VLC_CODEC_RGB32); p_thread->fmt.i_width = p_thread->fmt.i_visible_width = width; p_thread->fmt.i_height = p_thread->fmt.i_visible_height = height; - p_thread->fmt.i_chroma = VLC_CODEC_RGB32; p_thread->fmt.i_sar_num = p_thread->fmt.i_sar_den = 1; p_thread->fmt.color_range = COLOR_RANGE_FULL; @@ -135,6 +135,7 @@ static int Open( vlc_object_t *p_this ) p_thread->pool = picture_pool_NewFromFormat(&p_thread->fmt, 3); if (p_thread->pool == NULL) { + video_format_Clean(&p_thread->fmt); free(p_thread); return VLC_ENOMEM; } @@ -144,6 +145,7 @@ static int Open( vlc_object_t *p_this ) { msg_Err( p_filter, "no suitable vout module" ); picture_pool_Release(p_thread->pool); + video_format_Clean(&p_thread->fmt); free( p_thread ); return VLC_EGENERIC; } @@ -165,6 +167,7 @@ static int Open( vlc_object_t *p_this ) msg_Err( p_filter, "cannot launch goom thread" ); vout_Close( p_thread->p_vout ); picture_pool_Release(p_thread->pool); + video_format_Clean(&p_thread->fmt); free( p_thread ); return VLC_EGENERIC; } @@ -380,6 +383,7 @@ static void Close( filter_t *p_filter ) } picture_pool_Release(p_thread->pool); + video_format_Clean(&p_thread->fmt); free( p_thread ); }