[FFmpeg-cvslog] ws_snd1: Fix wrong samples counts.
Michael Niedermayer
git at videolan.org
Fri Feb 17 00:45:06 CET 2012
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Dec 25 00:10:27 2011 +0100| [9fb7a5af97d8c084c3af2566070d09eae0ab49fc] | committer: Justin Ruggles
ws_snd1: Fix wrong samples counts.
This makes the check that avoids overwrite of the samples array actually
work properly.
fixes CVE-2012-0848
CC: libav-stable at libav.org
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
Signed-off-by: Justin Ruggles <justin.ruggles at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9fb7a5af97d8c084c3af2566070d09eae0ab49fc
---
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 b2d086e..e8e4d15 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