[MPlayer-cvslog] r36843 - trunk/libmpcodecs/vd_ffmpeg.c

reimar subversion at mplayerhq.hu
Sat Feb 15 18:24:28 CET 2014


Author: reimar
Date: Sat Feb 15 18:24:28 2014
New Revision: 36843

Log:
Use calloc instead of malloc+memset.

Modified:
   trunk/libmpcodecs/vd_ffmpeg.c

Modified: trunk/libmpcodecs/vd_ffmpeg.c
==============================================================================
--- trunk/libmpcodecs/vd_ffmpeg.c	Sat Feb 15 18:24:27 2014	(r36842)
+++ trunk/libmpcodecs/vd_ffmpeg.c	Sat Feb 15 18:24:28 2014	(r36843)
@@ -325,10 +325,9 @@ static int init(sh_video_t *sh){
 
     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){


More information about the MPlayer-cvslog mailing list