changeset 36747:f42a82d80710

Use calloc instead of malloc+memset.
author reimar
date Sat, 15 Feb 2014 17:24:28 +0000
parents d9371aa0293f
children a31e7824ef36
files libmpcodecs/vd_ffmpeg.c
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/vd_ffmpeg.c	Sat Feb 15 17:24:27 2014 +0000
+++ b/libmpcodecs/vd_ffmpeg.c	Sat Feb 15 17:24:28 2014 +0000
@@ -325,10 +325,9 @@
 
     init_avcodec();
 
-    ctx = sh->context = malloc(sizeof(vd_ffmpeg_ctx));
+    ctx = sh->context = calloc(1, sizeof(*ctx));
     if (!ctx)
         return 0;
-    memset(ctx, 0, sizeof(vd_ffmpeg_ctx));
 
     lavc_codec = avcodec_find_decoder_by_name(sh->codec->dll);
     if(!lavc_codec){