[Mplayer-cvslog] CVS: main/libmpdemux demux_audio.c,1.24,1.25

Roberto Togni CVS syncmail at mplayerhq.hu
Thu Apr 15 22:48:29 CEST 2004


CVS change done by Roberto Togni CVS

Update of /cvsroot/mplayer/main/libmpdemux
In directory mail:/var2/tmp/cvs-serv18663

Modified Files:
	demux_audio.c 
Log Message:
10l to me: writing outside allocated memory
Patch by Mikulas Patocka < mikulas (at) artax (dot) karlin (dot) mff 
(dot) cuni (dot) cz>


Index: demux_audio.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpdemux/demux_audio.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- demux_audio.c	4 Oct 2003 22:00:25 -0000	1.24
+++ demux_audio.c	15 Apr 2004 20:48:27 -0000	1.25
@@ -168,7 +168,7 @@
       free_sh_audio(sh_audio);
       return 0;
     }
-    sh_audio->wf = w = (WAVEFORMATEX*)malloc(l);
+    sh_audio->wf = w = (WAVEFORMATEX*)malloc(l > sizeof(WAVEFORMATEX) ? l : sizeof(WAVEFORMATEX));
     w->wFormatTag = sh_audio->format = stream_read_word_le(s);
     w->nChannels = sh_audio->channels = stream_read_word_le(s);
     w->nSamplesPerSec = sh_audio->samplerate = stream_read_dword_le(s);




More information about the MPlayer-cvslog mailing list