[FFmpeg-cvslog] Fixed segfaults on corruped smacker streams in the decoder.
Laurent Aimar
git at videolan.org
Thu Nov 3 03:57:39 CET 2011
ffmpeg | branch: release/0.5 | Laurent Aimar <fenrir at videolan.org> | Sun Sep 11 18:54:01 2011 +0200| [b261ebfd220b05854d0a0cccde30eddb7a7e23dd] | committer: Michael Niedermayer
Fixed segfaults on corruped smacker streams in the decoder.
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit d07ac1853da29ea696243160e02154ebf758d1ee)
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b261ebfd220b05854d0a0cccde30eddb7a7e23dd
---
libavcodec/smacker.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c
index 716b63f..f790e08 100644
--- a/libavcodec/smacker.c
+++ b/libavcodec/smacker.c
@@ -660,6 +660,8 @@ static int smka_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
} else { //8-bit data
for(i = stereo; i >= 0; i--)
pred[i] = get_bits(&gb, 8);
+ if (stereo + unp_size > data_size)
+ return -1;
for(i = 0; i < stereo; i++)
*samples++ = (pred[i] - 0x80) << 8;
for(i = 0; i < unp_size; i++) {
More information about the ffmpeg-cvslog
mailing list