diff options
author | Paul B Mahol <onemda@gmail.com> | 2022-03-04 23:25:48 +0100 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2022-03-04 23:44:01 +0100 |
commit | 37480b1b85b0405563962b581dc2899b1b4bec59 (patch) | |
tree | 7239e10687679edba04c5863c00dd0365768b19a /libavcodec/dnxhdenc.c | |
parent | f497731260d42e920318ca745a8146febb9e055e (diff) |
avcodec/dnxhdenc: fix possible out of bound writes for big w/h
It was caused by integer overflows.
Diffstat (limited to 'libavcodec/dnxhdenc.c')
-rw-r--r-- | libavcodec/dnxhdenc.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/dnxhdenc.c b/libavcodec/dnxhdenc.c index ac92474e56..374fec499b 100644 --- a/libavcodec/dnxhdenc.c +++ b/libavcodec/dnxhdenc.c @@ -1228,6 +1228,9 @@ static int dnxhd_encode_fast(AVCodecContext *avctx, DNXHDEncContext *ctx) ctx->mb_qscale[mb] = ctx->qscale + 1; ctx->mb_bits[mb] = ctx->mb_rc[rc + ctx->m.mb_num].bits; } + + if (max_bits > ctx->frame_bits) + return AVERROR(EINVAL); } return 0; } |