[vlc-commits] [Git][videolan/vlc][master] 2 commits: video_filter: alphamask: initialize the mask pointer
Felix Paul Kühne (@fkuehne)
gitlab at videolan.org
Thu Oct 15 12:21:57 UTC 2026
Felix Paul Kühne pushed to branch master at VideoLAN / VLC
Commits:
2ce68360 by Martin Finkel at 2026-10-15T13:38:15+02:00
video_filter: alphamask: initialize the mask pointer
LoadMask() releases p_sys->p_mask, which Create() left uninitialized.
- - - - -
6de9daf8 by Martin Finkel at 2026-10-15T13:38:15+02:00
video_filter: alphamask: don't dereference a NULL mask
p_mask is NULL when no mask is set or it failed to load.
- - - - -
1 changed file:
- modules/video_filter/alphamask.c
Changes:
=====================================
modules/video_filter/alphamask.c
=====================================
@@ -105,6 +105,7 @@ static int Create( filter_t *p_filter )
if( p_filter->p_sys == NULL )
return VLC_ENOMEM;
p_sys = p_filter->p_sys;
+ p_sys->p_mask = NULL;
config_ChainParse( p_filter, CFG_PREFIX, ppsz_filter_options,
p_filter->p_cfg );
@@ -118,8 +119,6 @@ static int Create( filter_t *p_filter )
msg_Err( p_filter, "Error while loading mask (%s).",
psz_string );
}
- else
- p_sys->p_mask = NULL;
free( psz_string );
vlc_mutex_init( &p_sys->mask_lock );
@@ -148,6 +147,11 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
filter_sys_t *p_sys = p_filter->p_sys;
vlc_mutex_lock( &p_sys->mask_lock );
+ if( p_sys->p_mask == NULL )
+ {
+ vlc_mutex_unlock( &p_sys->mask_lock );
+ return p_pic;
+ }
plane_t *p_mask = p_sys->p_mask->p+A_PLANE;
plane_t *p_apic = p_pic->p+A_PLANE;
if( p_mask->i_visible_pitch
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/d921342a58297863cd3e5aa84509e42bf046bd8d...6de9daf8167ac85009b840261895391cf5909917
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/d921342a58297863cd3e5aa84509e42bf046bd8d...6de9daf8167ac85009b840261895391cf5909917
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help
More information about the vlc-commits
mailing list