aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/me_cmp.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2024-07-05 02:21:53 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2024-07-12 22:42:40 +0200
commit371265f0ec7fc0687da4b62c98b2bae97d43cf64 (patch)
tree3a422eb21019af82f2c2ddeff92d0793e64932a1 /libavcodec/me_cmp.c
parentd55327684349b4db5d5905eefaa7d2aec597908d (diff)
downloadffmpeg-371265f0ec7fc0687da4b62c98b2bae97d43cf64.tar.gz
avcodec/me_cmp: Fix type check
Fixes: CID1604375 Out-of-bounds read Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/me_cmp.c')
-rw-r--r--libavcodec/me_cmp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/me_cmp.c b/libavcodec/me_cmp.c
index 592ee76084..f3e2f2482e 100644
--- a/libavcodec/me_cmp.c
+++ b/libavcodec/me_cmp.c
@@ -517,7 +517,7 @@ av_cold int ff_set_cmp(const MECmpContext *c, me_cmp_func *cmp, int type, int mp
cmp[i] = zero_cmp;
return 0;
}
- if (type > FF_ARRAY_ELEMS(cmp_func_list) ||
+ if (type >= FF_ARRAY_ELEMS(cmp_func_list) ||
!cmp_func_list[type].available ||
!mpvenc && cmp_func_list[type].mpv_only) {
av_log(NULL, AV_LOG_ERROR,