summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2022-02-08 21:38:50 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2022-04-09 22:19:40 +0200
commit2262e53f965ded2049bc52b2cb4f912764a437f3 (patch)
tree940d21bf98bf1a628d07dca65365fc2d51089f4d
parentc7c714719ea1f913e42a4f69b4cf00265bcdaf1b (diff)
downloadffmpeg-2262e53f965ded2049bc52b2cb4f912764a437f3.tar.gz
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@niedermayer.cc> (cherry picked from commit 634312a70f4d5afd40058c52b4d8eade1da07a70) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/motion_est.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libavcodec/motion_est.c b/libavcodec/motion_est.c
index 8b5ce2117a..8fd5af1497 100644
--- a/libavcodec/motion_est.c
+++ b/libavcodec/motion_est.c
@@ -1614,7 +1614,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];
@@ -1631,7 +1631,6 @@ int ff_get_best_fcode(MpegEncContext * s, int16_t (*mv_table)[2], int type)
score[j]-= 170;
}
}
- xy++;
}
}