comparison libmpcodecs/vd_ffmpeg.c @ 36747:f42a82d80710

Use calloc instead of malloc+memset.
author reimar
date Sat, 15 Feb 2014 17:24:28 +0000
parents d9371aa0293f
children a31e7824ef36
comparison
equal deleted inserted replaced
36746:d9371aa0293f 36747:f42a82d80710
323 int lowres_w=0; 323 int lowres_w=0;
324 AVDictionary *opts = NULL; 324 AVDictionary *opts = NULL;
325 325
326 init_avcodec(); 326 init_avcodec();
327 327
328 ctx = sh->context = malloc(sizeof(vd_ffmpeg_ctx)); 328 ctx = sh->context = calloc(1, sizeof(*ctx));
329 if (!ctx) 329 if (!ctx)
330 return 0; 330 return 0;
331 memset(ctx, 0, sizeof(vd_ffmpeg_ctx));
332 331
333 lavc_codec = avcodec_find_decoder_by_name(sh->codec->dll); 332 lavc_codec = avcodec_find_decoder_by_name(sh->codec->dll);
334 if(!lavc_codec){ 333 if(!lavc_codec){
335 mp_msg(MSGT_DECVIDEO, MSGL_ERR, MSGTR_MissingLAVCcodec, sh->codec->dll); 334 mp_msg(MSGT_DECVIDEO, MSGL_ERR, MSGTR_MissingLAVCcodec, sh->codec->dll);
336 uninit(sh); 335 uninit(sh);