mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-12 02:19:35 +00:00
avcodec/dnxhdenc: fix possible out of bound writes for big w/h
It was caused by integer overflows.
This commit is contained in:
parent
f497731260
commit
37480b1b85
@ -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;
|
||||
}
|
||||
|
@ -34,7 +34,7 @@
|
||||
#include "dnxhddata.h"
|
||||
|
||||
typedef struct RCCMPEntry {
|
||||
uint16_t mb;
|
||||
uint32_t mb;
|
||||
int value;
|
||||
} RCCMPEntry;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user