summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-08-25 19:46:20 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-08-25 19:46:20 +0000
commit341e1c97e940999b7a1dce8dae5a2066adfc5d15 (patch)
treead517ca8463130ea1defc8aabea07a0c2bea510b /libmpcodecs
parent5d4798359ea481528363c535661e7b2165271963 (diff)
downloadmpv-341e1c97e940999b7a1dce8dae5a2066adfc5d15.tar.bz2
mpv-341e1c97e940999b7a1dce8dae5a2066adfc5d15.tar.xz
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
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/ad_pcm.c4
1 files changed, 2 insertions, 2 deletions
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;
}