[vlc-commits] video_filter/blendbench: Create: add missing error-check
Filip Roséen
git at videolan.org
Wed Mar 22 08:23:51 CET 2017
vlc | branch: master | Filip Roséen <filip at atch.se> | Wed Mar 22 04:40:07 2017 +0100| [e7d46eb5393d1529704398e6963b2bb17ef56713] | committer: Rémi Denis-Courmont
video_filter/blendbench: Create: add missing error-check
As blendbench.c:Filter relies on the p_sys->p_blend_image to refer to
a valid picture_t, we need to make sure that the relevant call is
successful in blendbench.c:Create (as we otherwise would have a
null-pointer dereference further down the road).
refs: #18116
fixes: #18145
Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e7d46eb5393d1529704398e6963b2bb17ef56713
---
modules/video_filter/blendbench.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/modules/video_filter/blendbench.c b/modules/video_filter/blendbench.c
index 47bf893..5f42436 100644
--- a/modules/video_filter/blendbench.c
+++ b/modules/video_filter/blendbench.c
@@ -195,11 +195,20 @@ static int Create( vlc_object_t *p_this )
p_sys->i_blend_chroma = VLC_FOURCC( psz_temp[0], psz_temp[1],
psz_temp[2], psz_temp[3] );
psz_cmd = var_CreateGetStringCommand( p_filter, CFG_PREFIX "blend-image" );
- blendbench_LoadImage( p_this, &p_sys->p_blend_image, p_sys->i_blend_chroma,
- psz_cmd, "Blend" );
+ i_ret = blendbench_LoadImage( p_this, &p_sys->p_blend_image, p_sys->i_blend_chroma,
+ psz_cmd, "Blend" );
+
free( psz_temp );
free( psz_cmd );
+ if( i_ret != VLC_SUCCESS )
+ {
+ picture_Release( p_sys->p_base_image );
+ free( p_sys );
+
+ return VLC_EGENERIC;
+ }
+
return VLC_SUCCESS;
}
More information about the vlc-commits
mailing list