Commit 5b6a50e1 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/mpegvideo_parser: Fix integer overflow

Fixes: signal_sigabrt_7ffff6ac8cc9_686_cov_1897408623_microsoft_new_way_to_shove_mpeg2_in_asf.dvr_ms

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent cf818be4
......@@ -159,11 +159,11 @@ static void mpegvideo_extract_headers(AVCodecParserContext *s,
av_log(avctx, AV_LOG_ERROR, "Failed to set dimensions\n");
if (avctx->codec_id == AV_CODEC_ID_MPEG2VIDEO && bit_rate) {
avctx->rc_max_rate = 400*bit_rate;
avctx->rc_max_rate = 400LL*bit_rate;
}
if (bit_rate &&
((avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO && bit_rate != 0x3FFFF) || vbv_delay != 0xFFFF)) {
avctx->bit_rate = 400*bit_rate;
avctx->bit_rate = 400LL*bit_rate;
}
if (pix_fmt != AV_PIX_FMT_NONE) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment