diff options
author | James Almer <jamrial@gmail.com> | 2023-04-13 10:19:57 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2023-04-14 10:04:47 -0300 |
commit | 7c6e26a18403376987541f1ca801ae225f8ee6d4 (patch) | |
tree | db0818413aa3aeaa0f0fca1bd4a72c921be33d23 /libavcodec/dvenc.c | |
parent | 5cda6b94f45c347805cbd5a0c7ed1d712b5722d7 (diff) |
avcodec/mp_cmp: reject invalid comparison function values
Fixes tickets #10306 and #10318.
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/dvenc.c')
-rw-r--r-- | libavcodec/dvenc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/dvenc.c b/libavcodec/dvenc.c index 11dd5763af..cd442b524d 100644 --- a/libavcodec/dvenc.c +++ b/libavcodec/dvenc.c @@ -104,7 +104,9 @@ static av_cold int dvvideo_encode_init(AVCodecContext *avctx) ff_fdctdsp_init(&fdsp, avctx); ff_me_cmp_init(&mecc, avctx); ff_pixblockdsp_init(&pdsp, avctx); - ff_set_cmp(&mecc, mecc.ildct_cmp, avctx->ildct_cmp); + ret = ff_set_cmp(&mecc, mecc.ildct_cmp, avctx->ildct_cmp); + if (ret < 0) + return AVERROR(EINVAL); s->get_pixels = pdsp.get_pixels; s->ildct_cmp = mecc.ildct_cmp[5]; |