Mercurial > mplayer.hg
changeset 25431:40bda123d2e7
Use calloc instead of malloc when allocate vobsub_t.
author | ulion |
---|---|
date | Wed, 19 Dec 2007 04:45:45 +0000 |
parents | 9e1bb05a4b17 |
children | 7957b8762195 |
files | vobsub.c |
diffstat | 1 files changed, 1 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/vobsub.c Wed Dec 19 02:18:56 2007 +0000 +++ b/vobsub.c Wed Dec 19 04:45:45 2007 +0000 @@ -1106,23 +1106,13 @@ void * vobsub_open(const char *const name,const char *const ifo,const int force,void** spu) { - vobsub_t *vob = malloc(sizeof(vobsub_t)); + vobsub_t *vob = calloc(1, sizeof(vobsub_t)); if(spu) *spu = NULL; if (vobsubid == -2) vobsubid = vobsub_id; if (vob) { char *buf; - vob->custom = 0; - vob->have_palette = 0; - vob->orig_frame_width = 0; - vob->orig_frame_height = 0; - vob->spu_streams = NULL; - vob->spu_streams_size = 0; - vob->spu_streams_current = 0; - vob->spu_valid_streams_size = 0; - vob->delay = 0; - vob->forced_subs=0; buf = malloc(strlen(name) + 5); if (buf) { rar_stream_t *fd;