[FFmpeg-cvslog] flashsv: Check diff_start diff_height values

Michael Niedermayer git at videolan.org
Sat Nov 2 09:45:47 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Aug 20 23:18:48 2013 +0200| [57070b1468edc6ac8cb3696c817f3c943975d4c1] | committer: Luca Barbato

flashsv: Check diff_start diff_height values

Fix out of array accesses.

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

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

 libavcodec/flashsv.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavcodec/flashsv.c b/libavcodec/flashsv.c
index f0a8036..a237aa7 100644
--- a/libavcodec/flashsv.c
+++ b/libavcodec/flashsv.c
@@ -383,6 +383,12 @@ static int flashsv_decode_frame(AVCodecContext *avctx, void *data,
                     }
                     s->diff_start  = get_bits(&gb, 8);
                     s->diff_height = get_bits(&gb, 8);
+                    if (s->diff_start + s->diff_height > cur_blk_height) {
+                        av_log(avctx, AV_LOG_ERROR,
+                               "Block parameters invalid: %d + %d > %d\n",
+                               s->diff_start, s->diff_height, cur_blk_height);
+                        return AVERROR_INVALIDDATA;
+                    }
                     av_log(avctx, AV_LOG_DEBUG,
                            "%dx%d diff start %d height %d\n",
                            i, j, s->diff_start, s->diff_height);



More information about the ffmpeg-cvslog mailing list