kwiberg
3a2c803dc3
Multiply in 64 bits to avoid overflow
...
A fuzzer run caused the operands of this multiplication to be 512 and
5000000, resulting in a product about 20% too large for int32_t. So
change this from a 16x32->32 to a 16x32->64 multiplication. Since we
right shift by 2 at the end, the end result will still fit in int32_t.
I also had to fix a few follow-on add/sub overflows found by the same
fuzzer input once the multiplication was fixed. I chose to saturate
these, since it wasn't just an intermediate value that overflowed.
BUG=chromium:693868
Review-Url: https://codereview.webrtc.org/2729573002
Cr-Commit-Position: refs/heads/master@{#17003}
2017-03-03 13:44:49 +00:00
..
2015-04-02 04:59:44 +00:00
2015-06-12 01:19:37 +00:00
2014-10-28 13:05:43 +00:00
2015-06-12 01:19:37 +00:00
2015-10-29 10:31:11 +00:00
2015-10-29 10:31:11 +00:00
2016-08-26 11:33:41 +00:00
2015-08-24 21:52:45 +00:00
2016-05-17 17:56:48 +00:00
2015-08-24 21:52:45 +00:00
2015-08-24 21:52:45 +00:00
2016-05-23 10:28:35 +00:00
2016-08-26 11:33:41 +00:00
2014-09-04 13:28:48 +00:00
2016-08-26 11:33:41 +00:00
2017-03-03 13:44:49 +00:00
2016-05-17 17:56:48 +00:00
2017-01-30 13:28:54 +00:00
2013-04-09 00:28:06 +00:00
2016-05-17 17:56:48 +00:00
2012-10-22 18:19:23 +00:00
2014-09-04 13:28:48 +00:00
2014-07-21 16:43:13 +00:00
2016-08-26 11:33:41 +00:00
2016-10-01 05:29:53 +00:00
2016-08-26 11:33:41 +00:00
2014-06-10 18:13:15 +00:00
2016-08-26 11:33:41 +00:00
2016-10-01 05:29:53 +00:00
2016-08-26 11:33:41 +00:00
2015-03-13 12:59:36 +00:00
2015-10-29 10:31:11 +00:00
2016-08-26 11:33:41 +00:00
2015-10-28 17:17:50 +00:00
2015-08-24 21:52:45 +00:00
2015-08-31 18:44:05 +00:00
2015-04-01 09:43:22 +00:00
2016-09-09 12:51:38 +00:00
2014-07-21 16:43:13 +00:00
2016-10-01 05:29:53 +00:00
2015-04-10 06:06:46 +00:00
2015-05-06 08:39:37 +00:00
2013-04-09 00:28:06 +00:00
2014-09-04 13:28:48 +00:00
2016-05-17 17:56:48 +00:00
2015-10-28 17:17:50 +00:00
2015-10-28 17:17:50 +00:00
2015-08-24 21:52:45 +00:00
2015-10-28 17:17:50 +00:00
2015-08-24 21:52:45 +00:00
2015-08-24 21:52:45 +00:00
2016-06-03 17:06:05 +00:00
2013-04-09 00:28:06 +00:00
2014-09-04 13:28:48 +00:00
2013-04-09 00:28:06 +00:00
2014-09-04 13:28:48 +00:00
2014-10-07 00:21:02 +00:00
2013-04-09 00:28:06 +00:00
2014-09-04 13:28:48 +00:00
2015-08-24 21:52:45 +00:00
2015-04-21 23:52:26 +00:00
2015-05-06 02:25:20 +00:00
2015-05-06 08:39:37 +00:00
2016-10-01 05:29:53 +00:00
2016-05-23 10:28:35 +00:00