[FFmpeg-cvslog] ws_snd1: Fix wrong samples count and crash.

Michael Niedermayer git at videolan.org
Sun Dec 25 00:23:39 CET 2011


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Dec 25 00:10:27 2011 +0100| [5257743aee0c3982f0079e6553aabc6aa39401d2] | committer: Michael Niedermayer

ws_snd1: Fix wrong samples count and crash.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5257743aee0c3982f0079e6553aabc6aa39401d2
---

 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 b7e28f5..2cb8bb4 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;
         }



More information about the ffmpeg-cvslog mailing list