diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-12-25 00:10:27 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-01-03 22:32:14 +0100 |
commit | 49db3600059010bbe284b8a2ed215eb561f01118 (patch) | |
tree | 84cbd969c95c4b1a639a0fce829889fc2d45806e | |
parent | 42476635baea4fa41dfbabee56318aaf92f40f7e (diff) | |
download | ffmpeg-49db3600059010bbe284b8a2ed215eb561f01118.tar.gz |
ws_snd1: Fix wrong samples count and crash.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5257743aee0c3982f0079e6553aabc6aa39401d2)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/ws-snd1.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/ws-snd1.c b/libavcodec/ws-snd1.c index b7e28f5e56..2cb8bb44a6 100644 --- a/libavcodec/ws-snd1.c +++ b/libavcodec/ws-snd1.c @@ -112,8 +112,8 @@ static int ws_snd_decode_frame(AVCodecContext *avctx, void *data, /* make sure we don't write past the output buffer */ switch (code) { - case 0: smp = 4; break; - case 1: smp = 2; break; + case 0: smp = 4*(count+1); break; + case 1: smp = 2*(count+1); break; case 2: smp = (count & 0x20) ? 1 : count + 1; break; default: smp = count + 1; break; } |