# HG changeset patch # User reimar # Date 1392485068 0 # Node ID f42a82d8071039962acde3f2266e58ec16de6272 # Parent d9371aa0293fd917080b66ae2abfb132cd214686 Use calloc instead of malloc+memset. diff -r d9371aa0293f -r f42a82d80710 libmpcodecs/vd_ffmpeg.c --- 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){