aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-09-02 20:54:42 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2015-09-02 20:55:09 +0200
commit5b6a50e15006d758ba308d5576a450406cd433f6 (patch)
treed78233a288ac3bac90dba536c1eb9667087c1081
parentcf818be4f2f1e06bf63da3a6b55a4c3620952070 (diff)
downloadffmpeg-5b6a50e15006d758ba308d5576a450406cd433f6.tar.gz
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>
-rw-r--r--libavcodec/mpegvideo_parser.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/mpegvideo_parser.c b/libavcodec/mpegvideo_parser.c
index f5ac63f21c..1f74bfb86b 100644
--- a/libavcodec/mpegvideo_parser.c
+++ b/libavcodec/mpegvideo_parser.c
@@ -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) {