[FFmpeg-cvslog] vc1: check that slices have a positive height
Anton Khirnov
git at videolan.org
Sun Mar 19 19:18:15 EET 2017
ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Sun Aug 14 10:18:39 2016 +0200| [33f10546ec012ad4e1054b57317885cded7e953e] | committer: Anton Khirnov
vc1: check that slices have a positive height
Fixes possible invalid reads.
CC: libav-stable at libav.org
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=33f10546ec012ad4e1054b57317885cded7e953e
---
libavcodec/vc1dec.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index 3d042d0..b26fbf2 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -881,6 +881,12 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
s->end_mb_y = (i == n_slices ) ? mb_height : FFMIN(mb_height, slices[i].mby_start % mb_height);
else
s->end_mb_y = (i <= n_slices1 + 1) ? mb_height : FFMIN(mb_height, slices[i].mby_start % mb_height);
+
+ if (s->end_mb_y <= s->start_mb_y) {
+ av_log(v->s.avctx, AV_LOG_ERROR, "Invalid slice size\n");
+ goto err;
+ }
+
ff_vc1_decode_blocks(v);
if (i != n_slices)
s->gb = slices[i].gb;
More information about the ffmpeg-cvslog
mailing list