mirror of https://github.com/mpv-player/mpv
replace malloc+memset by calloc
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20136 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
3b81347247
commit
37f549101b
|
@ -1007,8 +1007,7 @@ demux_mkv_read_trackentry (demuxer_t *demuxer)
|
||||||
uint64_t len, length, l;
|
uint64_t len, length, l;
|
||||||
int il;
|
int il;
|
||||||
|
|
||||||
track = malloc (sizeof (*track));
|
track = calloc (1, sizeof (*track));
|
||||||
memset(track, 0, sizeof(*track));
|
|
||||||
/* set default values */
|
/* set default values */
|
||||||
track->default_track = 1;
|
track->default_track = 1;
|
||||||
track->name = 0;
|
track->name = 0;
|
||||||
|
@ -1769,8 +1768,7 @@ demux_mkv_open_video (demuxer_t *demuxer, mkv_track_t *track, int vid)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
src = (BITMAPINFOHEADER *) track->private_data;
|
src = (BITMAPINFOHEADER *) track->private_data;
|
||||||
bih = malloc (track->private_size);
|
bih = calloc (1, track->private_size);
|
||||||
memset (bih, 0, track->private_size);
|
|
||||||
bih->biSize = le2me_32 (src->biSize);
|
bih->biSize = le2me_32 (src->biSize);
|
||||||
bih->biWidth = le2me_32 (src->biWidth);
|
bih->biWidth = le2me_32 (src->biWidth);
|
||||||
bih->biHeight = le2me_32 (src->biHeight);
|
bih->biHeight = le2me_32 (src->biHeight);
|
||||||
|
@ -1793,8 +1791,7 @@ demux_mkv_open_video (demuxer_t *demuxer, mkv_track_t *track, int vid)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
bih = malloc (sizeof (BITMAPINFOHEADER));
|
bih = calloc (1, sizeof (BITMAPINFOHEADER));
|
||||||
memset (bih, 0, sizeof (BITMAPINFOHEADER));
|
|
||||||
bih->biSize = sizeof (BITMAPINFOHEADER);
|
bih->biSize = sizeof (BITMAPINFOHEADER);
|
||||||
bih->biWidth = track->v_width;
|
bih->biWidth = track->v_width;
|
||||||
bih->biHeight = track->v_height;
|
bih->biHeight = track->v_height;
|
||||||
|
@ -2432,8 +2429,7 @@ demux_mkv_open (demuxer_t *demuxer)
|
||||||
|
|
||||||
mp_msg (MSGT_DEMUX, MSGL_V, "[mkv] + a segment...\n");
|
mp_msg (MSGT_DEMUX, MSGL_V, "[mkv] + a segment...\n");
|
||||||
|
|
||||||
mkv_d = malloc (sizeof (mkv_demuxer_t));
|
mkv_d = calloc (1, sizeof (mkv_demuxer_t));
|
||||||
memset (mkv_d, 0, sizeof(mkv_demuxer_t));
|
|
||||||
demuxer->priv = mkv_d;
|
demuxer->priv = mkv_d;
|
||||||
mkv_d->tc_scale = 1000000;
|
mkv_d->tc_scale = 1000000;
|
||||||
mkv_d->segment_start = stream_tell (s);
|
mkv_d->segment_start = stream_tell (s);
|
||||||
|
|
Loading…
Reference in New Issue