# HG changeset patch # User arpi_esp # Date 987345915 0 # Node ID 0969d4ef0a34107b48636a482497325e1c38dfd2 # Parent 5251b0c57e39e912cdfc88c281be5d580873f396 malloc->calloc at wf/bih allocation diff -r 5251b0c57e39 -r 0969d4ef0a34 aviheader.c --- a/aviheader.c Sun Apr 15 14:33:49 2001 +0000 +++ b/aviheader.c Sun Apr 15 14:45:15 2001 +0000 @@ -56,8 +56,9 @@ break; } case ckidSTREAMFORMAT: { // read 'strf' if(last_fccType==streamtypeVIDEO){ - sh_video->bih=malloc(chunksize); memset(sh_video->bih,0,chunksize); - if(verbose>=2) printf("found 'bih', %d bytes of %d\n",chunksize,sizeof(BITMAPINFOHEADER)); + sh_video->bih=calloc((chunksizebih=malloc(chunksize); memset(sh_video->bih,0,chunksize); + if(verbose>=1) printf("found 'bih', %d bytes of %d\n",chunksize,sizeof(BITMAPINFOHEADER)); stream_read(demuxer->stream,(char*) sh_video->bih,chunksize); chunksize=0; // sh_video->fps=(float)sh_video->video.dwRate/(float)sh_video->video.dwScale; @@ -65,8 +66,9 @@ // if(demuxer->video->id==-1) demuxer->video->id=stream_id; } else if(last_fccType==streamtypeAUDIO){ - sh_audio->wf=malloc(chunksize); memset(sh_audio->wf,0,chunksize); - if(verbose>=2) printf("found 'wf', %d bytes of %d\n",chunksize,sizeof(WAVEFORMATEX)); + sh_audio->wf=calloc((chunksizewf=malloc(chunksize); memset(sh_audio->wf,0,chunksize); + if(verbose>=1) printf("found 'wf', %d bytes of %d\n",chunksize,sizeof(WAVEFORMATEX)); stream_read(demuxer->stream,(char*) sh_audio->wf,chunksize); chunksize=0; if(verbose>=1) print_wave_header(sh_audio->wf);