diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2021-05-31 21:40:17 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-06-08 18:00:05 +0200 |
commit | f7862e82686b347eb6a9e64fa7ccdf25d5a76b4b (patch) | |
tree | a88a8ee3c3ba67ac2f972a088898ddfee55ee662 /libavcodec/vc2enc.c | |
parent | 7af1a3cebef6d9654675252f57689d46ac17d1e9 (diff) | |
download | ffmpeg-f7862e82686b347eb6a9e64fa7ccdf25d5a76b4b.tar.gz |
avcodec/vc2enc: Check for non negative slice bounds
Fixes: invalid shifts
Fixes: Ticket 8221
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/vc2enc.c')
-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 2de6d4b17a..f0d2cdf62d 100644 --- a/libavcodec/vc2enc.c +++ b/libavcodec/vc2enc.c @@ -982,6 +982,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) |