summaryrefslogtreecommitdiffstats
path: root/aviheader.c
diff options
context:
space:
mode:
authorarpi_esp <arpi_esp@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-04-15 14:45:15 +0000
committerarpi_esp <arpi_esp@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-04-15 14:45:15 +0000
commit544e51e95c3355282e837e89751a01d23c21f18d (patch)
tree41658b5359850bab82e5a57f676d23753cc61fee /aviheader.c
parent415c45924b85bd3e733dbb87393bd1a425eadd4a (diff)
downloadmpv-544e51e95c3355282e837e89751a01d23c21f18d.tar.bz2
mpv-544e51e95c3355282e837e89751a01d23c21f18d.tar.xz
malloc->calloc at wf/bih allocation
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@434 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'aviheader.c')
-rw-r--r--aviheader.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/aviheader.c b/aviheader.c
index 9154c2f31c..7585cacdbc 100644
--- a/aviheader.c
+++ b/aviheader.c
@@ -56,8 +56,9 @@ while(1){
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((chunksize<sizeof(BITMAPINFOHEADER))?sizeof(BITMAPINFOHEADER):chunksize,1);
+// sh_video->bih=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 @@ while(1){
// 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((chunksize<sizeof(WAVEFORMATEX))?sizeof(WAVEFORMATEX):chunksize,1);
+// sh_audio->wf=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);