# HG changeset patch # User reimar # Date 1124999180 0 # Node ID 03cd6abe5664565876ab1f65c5bf82ff65c4c2c5 # Parent 7f88103a97108d8537aa7383d7bc4de8a9db6a51 avoid reading more than maxlen bytes. Has the sideeffect that the amount read will be close to maxlen instead of minlen as before. diff -r 7f88103a9710 -r 03cd6abe5664 libmpcodecs/ad_pcm.c --- a/libmpcodecs/ad_pcm.c Thu Aug 25 18:22:12 2005 +0000 +++ b/libmpcodecs/ad_pcm.c Thu Aug 25 19:46:20 2005 +0000 @@ -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; }