]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/agm: Fix off by 1 error in decode_inter_plane()
authorMichael Niedermayer <michael@niedermayer.cc>
Thu, 10 Sep 2020 16:52:48 +0000 (18:52 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Thu, 10 Sep 2020 21:31:10 +0000 (23:31 +0200)
Fixes: Regression since 1f2096945709a32315da740691b5716da55893c3
Found-by: Paul B Mahol <onemda@gmail.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/agm.c

index 19490c54564b2ebf822dd466b1338d2374ae5f53..f60cbf1a187499c3efc8cf4c24688a68e0ddc5cf 100644 (file)
@@ -423,8 +423,8 @@ static int decode_inter_plane(AGMContext *s, GetBitContext *gb, int size,
                 int map = s->map[x];
 
                 if (orig_mv_x >= -32) {
-                    if (y * 8 + mv_y < 0 || y * 8 + mv_y + 8 >= h ||
-                        x * 8 + mv_x < 0 || x * 8 + mv_x + 8 >= w)
+                    if (y * 8 + mv_y < 0 || y * 8 + mv_y + 8 > h ||
+                        x * 8 + mv_x < 0 || x * 8 + mv_x + 8 > w)
                         return AVERROR_INVALIDDATA;
 
                     copy_block8(frame->data[plane] + (s->blocks_h - 1 - y) * 8 * frame->linesize[plane] + x * 8,