[vlc-commits] win32: use vlc_alloc helper
Thomas Guillem
git at videolan.org
Sat Nov 11 19:00:26 CET 2017
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Sat Nov 11 18:52:34 2017 +0100| [b66af2e8e32c9ff7b32827357bc5fbd7bd245541] | committer: Thomas Guillem
win32: use vlc_alloc helper
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b66af2e8e32c9ff7b32827357bc5fbd7bd245541
---
modules/video_output/win32/direct3d9.c | 2 +-
modules/video_output/win32/events.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules/video_output/win32/direct3d9.c b/modules/video_output/win32/direct3d9.c
index b8d292dec9..bf51a5d78d 100644
--- a/modules/video_output/win32/direct3d9.c
+++ b/modules/video_output/win32/direct3d9.c
@@ -1417,7 +1417,7 @@ static int Direct3D9CreateShaders(vout_display_t *vd)
if (length == -1 || length >= MAX_SHADER_FILE_SIZE)
goto error;
rewind(fs);
- shader_source_file = malloc(sizeof(*shader_source_file) * length);
+ shader_source_file = vlc_alloc(length, sizeof(*shader_source_file));
if (!shader_source_file)
goto error;
ret = fread(shader_source_file, length, 1, fs);
diff --git a/modules/video_output/win32/events.c b/modules/video_output/win32/events.c
index 935ac562f7..3ed20a69ab 100644
--- a/modules/video_output/win32/events.c
+++ b/modules/video_output/win32/events.c
@@ -358,7 +358,7 @@ static void *EventThread( void *p_this )
if( p_event->psz_title )
{
const size_t i_length = strlen(p_event->psz_title);
- pwz_title = malloc( 2 * (i_length + 1) );
+ pwz_title = vlc_alloc( i_length + 1, 2 );
if( pwz_title )
{
mbstowcs( pwz_title, p_event->psz_title, 2 * i_length );
More information about the vlc-commits
mailing list