[MPlayer-cvslog] CVS: main/libmpcodecs ad_pcm.c,1.18,1.19

Reimar Döffinger CVS syncmail at mplayerhq.hu
Thu Aug 25 21:46:22 CEST 2005


CVS change done by Reimar Döffinger CVS

Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var2/tmp/cvs-serv4590

Modified Files:
	ad_pcm.c 
Log Message:
avoid reading more than maxlen bytes.
Has the sideeffect that the amount read will be close to maxlen instead
of minlen as before.


Index: ad_pcm.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/ad_pcm.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- ad_pcm.c	28 Jul 2005 13:43:24 -0000	1.18
+++ ad_pcm.c	25 Aug 2005 19:46:20 -0000	1.19
@@ -98,8 +98,8 @@
 
 static int decode_audio(sh_audio_t *sh_audio,unsigned char *buf,int minlen,int maxlen)
 {
-  int len=sh_audio->channels*sh_audio->samplesize-1;
-  len=(minlen+len)&(~len); // sample align
+  unsigned len = sh_audio->channels*sh_audio->samplesize;
+  len = maxlen - maxlen % len; // sample align
   len=demux_read_data(sh_audio->ds,buf,len);
   return len;
 }




More information about the MPlayer-cvslog mailing list