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: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2015-09-02 20:54:42 +02:00
parent cf818be4f2
commit 5b6a50e150
1 changed files with 2 additions and 2 deletions

View File

@ -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) {