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

Michael Niedermayer git at videolan.org
Thu Jan 12 22:03:05 CET 2012


ffmpeg | branch: release/0.8 | Michael Niedermayer <michaelni at gmx.at> | Sun Dec 25 00:10:27 2011 +0100| [d80db23e7d3130ee5f5f6fff7e6db3274cdd6a98] | committer: Michael Niedermayer

ws_snd1: Fix wrong samples count and crash.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 5257743aee0c3982f0079e6553aabc6aa39401d2)

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

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

 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 f92c353..c28d1a8 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;
         }



More information about the ffmpeg-cvslog mailing list