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>
release/7.1
Michael Niedermayer 6 months ago
parent d553276843
commit 371265f0ec
  1. 2
      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; cmp[i] = zero_cmp;
return 0; return 0;
} }
if (type > FF_ARRAY_ELEMS(cmp_func_list) || if (type >= FF_ARRAY_ELEMS(cmp_func_list) ||
!cmp_func_list[type].available || !cmp_func_list[type].available ||
!mpvenc && cmp_func_list[type].mpv_only) { !mpvenc && cmp_func_list[type].mpv_only) {
av_log(NULL, AV_LOG_ERROR, av_log(NULL, AV_LOG_ERROR,

Loading…
Cancel
Save