comparison libmpdemux/demux_lmlm4.c @ 32119:e2a7509972d4

Replace malloc+memset by calloc
author reimar
date Sun, 12 Sep 2010 15:48:46 +0000
parents bf37d5ac4516
children d332ea379205
comparison
equal deleted inserted replaced
32118:bb29c8d135ed 32119:e2a7509972d4
308 sh_video->ds = demuxer->video; 308 sh_video->ds = demuxer->video;
309 sh_video->disp_w = 640; 309 sh_video->disp_w = 640;
310 sh_video->disp_h = 480; 310 sh_video->disp_h = 480;
311 sh_video->format = mmioFOURCC('D','I','V','X'); 311 sh_video->format = mmioFOURCC('D','I','V','X');
312 312
313 sh_video->bih = malloc(sizeof(BITMAPINFOHEADER)); 313 sh_video->bih = calloc(1, sizeof(BITMAPINFOHEADER));
314 memset(sh_video->bih, 0, sizeof(BITMAPINFOHEADER));
315 314
316 /* these are false values */ 315 /* these are false values */
317 sh_video->bih->biSize = 40; 316 sh_video->bih->biSize = 40;
318 sh_video->bih->biWidth = sh_video->disp_w; 317 sh_video->bih->biWidth = sh_video->disp_w;
319 sh_video->bih->biHeight = sh_video->disp_h; 318 sh_video->bih->biHeight = sh_video->disp_h;
324 323
325 sh_audio = new_sh_audio(demuxer, 0, NULL); 324 sh_audio = new_sh_audio(demuxer, 0, NULL);
326 demuxer->audio->sh = sh_audio; 325 demuxer->audio->sh = sh_audio;
327 sh_audio->ds = demuxer->audio; 326 sh_audio->ds = demuxer->audio;
328 327
329 sh_audio->wf = malloc(sizeof(WAVEFORMATEX)); 328 sh_audio->wf = calloc(1, sizeof(WAVEFORMATEX));
330 memset(sh_audio->wf, 0, sizeof(WAVEFORMATEX));
331 329
332 sh_audio->samplerate = 48000; 330 sh_audio->samplerate = 48000;
333 sh_audio->wf->wBitsPerSample = 16; 331 sh_audio->wf->wBitsPerSample = 16;
334 sh_audio->channels = 2; 332 sh_audio->channels = 2;
335 sh_audio->format = 0x50; 333 sh_audio->format = 0x50;