Message ID | 20200910170454.831-1-michael@niedermayer.cc |
---|---|
State | Accepted |
Commit | 6d71a25cc460960c49997d52c1d1f1c39ccc38b4 |
Headers | show |
Series | [FFmpeg-devel] avcodec/agm: Fix off by 1 error in decode_inter_plane() | expand |
Context | Check | Description |
---|---|---|
andriy/default | pending | |
andriy/make | success | Make finished |
andriy/make_fate | success | Make fate finished |
On Thu, Sep 10, 2020 at 07:04:54PM +0200, Michael Niedermayer wrote: > Fixes: Regression since 1f2096945709a32315da740691b5716da55893c3 > Found-by: <durandal_1707> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> > --- > libavcodec/agm.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > lgtm
On Thu, Sep 10, 2020 at 09:15:22PM +0200, Paul B Mahol wrote: > On Thu, Sep 10, 2020 at 07:04:54PM +0200, Michael Niedermayer wrote: > > Fixes: Regression since 1f2096945709a32315da740691b5716da55893c3 > > Found-by: <durandal_1707> > > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> > > --- > > libavcodec/agm.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > lgtm will apply thx [...]
diff --git a/libavcodec/agm.c b/libavcodec/agm.c index 19490c5456..f60cbf1a18 100644 --- a/libavcodec/agm.c +++ b/libavcodec/agm.c @@ -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,
Fixes: Regression since 1f2096945709a32315da740691b5716da55893c3 Found-by: <durandal_1707> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> --- libavcodec/agm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)