diff --git a/modules/video_filter/scene.c b/modules/video_filter/scene.c index a9cae368f5a9a94f7e72fd14d46a0d0d33e02c96..811d34659433ff981a1347b1327d565fa585dd63 100644 --- a/modules/video_filter/scene.c +++ b/modules/video_filter/scene.c @@ -194,6 +194,16 @@ static int Create( filter_t *p_filter ) if( p_sys->psz_path == NULL ) p_sys->psz_path = config_GetUserDir( VLC_PICTURES_DIR ); + if (unlikely(p_sys->psz_path == NULL)) + { + msg_Err( p_filter, "could not create snapshot: no directory" ); + image_HandlerDelete( p_sys->p_image ); + free( p_sys->psz_prefix ); + free( p_sys->psz_format ); + free( p_sys ); + return VLC_EGENERIC; + } + static const struct vlc_filter_operations filter_ops = { .filter_video = Filter, .close = Destroy,