ad_pcm: fix crash at EOF

Fix use of unsigned type where negative values were needed. When
playing a file with multichannel PCM audio the bug could result in the
channel reorder function scrambling memory at the end of playback,
causing a crash.
This commit is contained in:
Uoti Urpala 2010-05-15 05:47:06 +03:00
parent 584b43e9f8
commit c1c68a6914
1 changed files with 1 additions and 1 deletions

View File

@ -151,7 +151,7 @@ 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)
{
unsigned len = sh_audio->channels * sh_audio->samplesize;
int len = sh_audio->channels * sh_audio->samplesize;
minlen = (minlen + len - 1) / len * len;
if (minlen > maxlen)
// if someone needs hundreds of channels adjust audio_out_minsize