ws_snd1: Fix wrong samples count and crash.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 9fb7a5af97)

Addresses CVE-2012-0848

Reviewed-by: Justin Ruggles <justin.ruggles@gmail.com>
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
This commit is contained in:
Michael Niedermayer 2011-12-25 00:10:27 +01:00 committed by Reinhard Tartler
parent 4c7879775e
commit 697a45d861
1 changed files with 2 additions and 2 deletions

View File

@ -112,8 +112,8 @@ static int ws_snd_decode_frame(AVCodecContext *avctx, void *data,
/* make sure we don't write past the output buffer */ /* make sure we don't write past the output buffer */
switch (code) { switch (code) {
case 0: smp = 4; break; case 0: smp = 4*(count+1); break;
case 1: smp = 2; break; case 1: smp = 2*(count+1); break;
case 2: smp = (count & 0x20) ? 1 : count + 1; break; case 2: smp = (count & 0x20) ? 1 : count + 1; break;
default: smp = count + 1; break; default: smp = count + 1; break;
} }