diff options
author | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-05-15 05:47:06 +0300 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-05-15 05:52:00 +0300 |
commit | c1c68a6914e54a16ad99dcc60833210fca4bb64a (patch) | |
tree | 9a3d517ea59bcc93992f10d474fa43f0eb130276 /libmpcodecs | |
parent | 584b43e9f80c924eac1c13ee8f45e0f5c0b48840 (diff) | |
download | mpv-c1c68a6914e54a16ad99dcc60833210fca4bb64a.tar.bz2 mpv-c1c68a6914e54a16ad99dcc60833210fca4bb64a.tar.xz |
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.
Diffstat (limited to 'libmpcodecs')
-rw-r--r-- | libmpcodecs/ad_pcm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libmpcodecs/ad_pcm.c b/libmpcodecs/ad_pcm.c index b4d8a3f348..6df408abd3 100644 --- a/libmpcodecs/ad_pcm.c +++ b/libmpcodecs/ad_pcm.c @@ -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 |