[FFmpeg-cvslog] avcodec/motion_est: Fix xy indexing on range violation in ff_get_best_fcode()
Michael Niedermayer
git at videolan.org
Mon Apr 18 19:06:23 EEST 2022
ffmpeg | branch: release/3.2 | Michael Niedermayer <michael at niedermayer.cc> | Tue Feb 8 21:38:50 2022 +0100| [a198d7ab26a8b9756b71d20c1075957fb2fc2bc0] | committer: Michael Niedermayer
avcodec/motion_est: Fix xy indexing on range violation in ff_get_best_fcode()
This codepath seems untested, no testcases change
Found-by: <mkver>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 634312a70f4d5afd40058c52b4d8eade1da07a70)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a198d7ab26a8b9756b71d20c1075957fb2fc2bc0
---
libavcodec/motion_est.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/libavcodec/motion_est.c b/libavcodec/motion_est.c
index 25b606f819..5fb5e5e6e7 100644
--- a/libavcodec/motion_est.c
+++ b/libavcodec/motion_est.c
@@ -1634,7 +1634,7 @@ int ff_get_best_fcode(MpegEncContext * s, int16_t (*mv_table)[2], int type)
for(y=0; y<s->mb_height; y++){
int x;
int xy= y*s->mb_stride;
- for(x=0; x<s->mb_width; x++){
+ for(x=0; x<s->mb_width; x++, xy++){
if(s->mb_type[xy] & type){
int mx= mv_table[xy][0];
int my= mv_table[xy][1];
@@ -1651,7 +1651,6 @@ int ff_get_best_fcode(MpegEncContext * s, int16_t (*mv_table)[2], int type)
score[j]-= 170;
}
}
- xy++;
}
}
More information about the ffmpeg-cvslog
mailing list