From 341e1c97e940999b7a1dce8dae5a2066adfc5d15 Mon Sep 17 00:00:00 2001 From: reimar Date: Thu, 25 Aug 2005 19:46:20 +0000 Subject: avoid reading more than maxlen bytes. Has the sideeffect that the amount read will be close to maxlen instead of minlen as before. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16308 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/ad_pcm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libmpcodecs/ad_pcm.c') diff --git a/libmpcodecs/ad_pcm.c b/libmpcodecs/ad_pcm.c index fed9c141ba..7e67c938ae 100644 --- a/libmpcodecs/ad_pcm.c +++ b/libmpcodecs/ad_pcm.c @@ -98,8 +98,8 @@ static int control(sh_audio_t *sh,int cmd,void* arg, ...) 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; } -- cgit v1.2.3