diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2021-05-31 22:40:17 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-10-06 14:54:16 +0300 |
commit | c86f19e47c7ea0d5581cf182b2a757b5792be01e (patch) | |
tree | 35fc7ea7675f701bcb632537a08dce4ad2b355d6 /libavcodec | |
parent | 511989d2a7f0a6a0f36cb3b3dca648ed6b05d2ed (diff) |
avcodec/vc2enc: Check for non negative slice bounds
Fixes: invalid shifts
Fixes: Ticket 8221
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit f7862e82686b347eb6a9e64fa7ccdf25d5a76b4b)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/vc2enc.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/vc2enc.c b/libavcodec/vc2enc.c index d0101e01e4..e83442ed55 100644 --- a/libavcodec/vc2enc.c +++ b/libavcodec/vc2enc.c @@ -981,6 +981,8 @@ static av_cold int vc2_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, } s->slice_min_bytes = s->slice_max_bytes - s->slice_max_bytes*(s->tolerance/100.0f); + if (s->slice_min_bytes < 0) + return AVERROR(EINVAL); ret = encode_frame(s, avpkt, frame, aux_data, header_size, s->interlaced); if (ret) |