aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-12-25 00:10:27 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-01-12 21:52:10 +0100
commitd80db23e7d3130ee5f5f6fff7e6db3274cdd6a98 (patch)
treec6e0acd3fc36beb607b4b340118fbb739411e316
parentc4cc8584d0e48a9474a52eed725ed726d14d3f2f (diff)
downloadffmpeg-d80db23e7d3130ee5f5f6fff7e6db3274cdd6a98.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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/ws-snd1.c b/libavcodec/ws-snd1.c
index f92c3531e0..c28d1a8d6a 100644
--- a/libavcodec/ws-snd1.c
+++ b/libavcodec/ws-snd1.c
@@ -100,8 +100,8 @@ static int ws_snd_decode_frame(AVCodecContext *avctx,
/* make sure we don't write more than out_size samples */
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;
}