[FFmpeg-cvslog] avcodec/flashsv: check diff_start/height

Michael Niedermayer git at videolan.org
Sun Aug 25 13:20:46 CEST 2013


ffmpeg | branch: release/0.11 | Michael Niedermayer <michaelni at gmx.at> | Tue Aug 20 23:18:48 2013 +0200| [b25c3063b2fcad7bcf6a7337f101990085b1983d] | committer: Michael Niedermayer

avcodec/flashsv: check diff_start/height

Fixes out of array accesses
Fixes Ticket2844

Found-by: ami_stuff
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 880c73cd76109697447fbfbaa8e5ee5683309446)

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

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

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

diff --git a/libavcodec/flashsv.c b/libavcodec/flashsv.c
index 0e5543d..d9277c4 100644
--- a/libavcodec/flashsv.c
+++ b/libavcodec/flashsv.c
@@ -373,6 +373,10 @@ static int flashsv_decode_frame(AVCodecContext *avctx, void *data,
                 if (has_diff) {
                     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\n");
+                        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