Commit d193abf8 authored by Eugene Zemtsov's avatar Eugene Zemtsov Committed by Commit Bot

Fix integer overflow

N.B. libvpx will later check that frame diminsions don't exceed
codec specific limits.

Bug: 1127590
Change-Id: I20d635169a63e81eed40a7cc3ee4a77284a753ea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2411672Reviewed-by: default avatarThomas Guilbert <tguilbert@chromium.org>
Commit-Queue: Eugene Zemtsov <eugene@chromium.org>
Cr-Commit-Position: refs/heads/master@{#807138}
parent 63eb0d33
...@@ -65,7 +65,7 @@ Status SetUpVpxConfig(const VideoEncoder::Options& opts, ...@@ -65,7 +65,7 @@ Status SetUpVpxConfig(const VideoEncoder::Options& opts,
config->rc_target_bitrate = opts.bitrate.value() / 1000; config->rc_target_bitrate = opts.bitrate.value() / 1000;
} else { } else {
config->rc_end_usage = VPX_VBR; config->rc_end_usage = VPX_VBR;
config->rc_target_bitrate = static_cast<double>(opts.width * opts.height) / config->rc_target_bitrate = double{opts.width} * double{opts.height} /
config->g_w / config->g_h * config->g_w / config->g_h *
config->rc_target_bitrate; config->rc_target_bitrate;
} }
......
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