Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(270)

Issue 1307893004: NetEq: Fixing a bug that caused rtc::checked_cast to trigger (Closed)

Created:
5 years, 3 months ago by hlundin-webrtc
Modified:
5 years, 3 months ago
CC:
webrtc-reviews_webrtc.org, tterriberry_mozilla.com, kwiberg-webrtc, tlegrand-webrtc
Base URL:
https://chromium.googlesource.com/external/webrtc.git@master
Target Ref:
refs/pending/heads/master
Project:
webrtc
Visibility:
Public.

Description

NetEq: Fixing a bug that caused rtc::checked_cast to trigger This is a bug that was introduced in https://codereview.webrtc.org/1230503003, where the variable "int temp_bufsize" was changed to a size_t. If the packet buffer was flushed while inserting a packet, temp_bufsize became negative, which was tested later in an if-statement. Now, with size_t instead, it would just become very large, and the if-statement would never see a negative value. The effect was that the packet size in samples could be updated with a very large positive number, causing an overflow which triggered rtc::checked_cast in StatisticsCalculator::GetNetworkStatistics, line 220. Also adding a test to reproduce the crash. Without the fix, the test results in the above mentioned checked_cast to trigger. With the fix, everything works fine. BUG=chromium:525260 Committed: https://crrev.com/116c84e1b0b7d584a0f04f11de9b2bdb71b25040 Cr-Commit-Position: refs/heads/master@{#9802}

Patch Set 1 #

Patch Set 2 : Adding test description #

Total comments: 8

Patch Set 3 : Review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+54 lines, -9 lines) Patch
M webrtc/modules/audio_coding/neteq/neteq_impl.cc View 2 chunks +14 lines, -9 lines 0 comments Download
M webrtc/modules/audio_coding/neteq/neteq_impl_unittest.cc View 1 2 2 chunks +40 lines, -0 lines 0 comments Download

Messages

Total messages: 28 (9 generated)
hlundin-webrtc
Minyue, Ivo (cc: pkasting) Please, take a look at this CL. Thanks! /HL
5 years, 3 months ago (2015-08-27 08:21:56 UTC) #3
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1307893004/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1307893004/1
5 years, 3 months ago (2015-08-27 08:22:32 UTC) #5
hlundin-webrtc
Adding test description
5 years, 3 months ago (2015-08-27 08:28:45 UTC) #6
ivoc
LGTM, nice find, looks like a tricky bug to track down.
5 years, 3 months ago (2015-08-27 08:42:59 UTC) #7
Peter Kasting
Thanks again for this! It looks like this was the only non-test callsite of InsertPacketList(), ...
5 years, 3 months ago (2015-08-27 08:45:33 UTC) #9
minyue-webrtc
lgtm Nice catch. https://codereview.chromium.org/1307893004/diff/20001/webrtc/modules/audio_coding/neteq/neteq_impl.cc File webrtc/modules/audio_coding/neteq/neteq_impl.cc (left): https://codereview.chromium.org/1307893004/diff/20001/webrtc/modules/audio_coding/neteq/neteq_impl.cc#oldcode661 webrtc/modules/audio_coding/neteq/neteq_impl.cc:661: if ((temp_bufsize > 0) && Since ...
5 years, 3 months ago (2015-08-27 09:09:30 UTC) #10
Peter Kasting
https://codereview.chromium.org/1307893004/diff/20001/webrtc/modules/audio_coding/neteq/neteq_impl.cc File webrtc/modules/audio_coding/neteq/neteq_impl.cc (left): https://codereview.chromium.org/1307893004/diff/20001/webrtc/modules/audio_coding/neteq/neteq_impl.cc#oldcode661 webrtc/modules/audio_coding/neteq/neteq_impl.cc:661: if ((temp_bufsize > 0) && On 2015/08/27 09:09:30, minyue-webrtc ...
5 years, 3 months ago (2015-08-27 09:14:54 UTC) #11
minyue-webrtc
On 2015/08/27 09:14:54, Peter Kasting wrote: > https://codereview.chromium.org/1307893004/diff/20001/webrtc/modules/audio_coding/neteq/neteq_impl.cc > File webrtc/modules/audio_coding/neteq/neteq_impl.cc (left): > > https://codereview.chromium.org/1307893004/diff/20001/webrtc/modules/audio_coding/neteq/neteq_impl.cc#oldcode661 ...
5 years, 3 months ago (2015-08-27 09:36:50 UTC) #12
Peter Kasting
On 2015/08/27 09:36:50, minyue-webrtc wrote: > On 2015/08/27 09:14:54, Peter Kasting wrote: > > > ...
5 years, 3 months ago (2015-08-27 09:44:01 UTC) #13
hlundin-webrtc
On 2015/08/27 09:44:01, Peter Kasting wrote: > On 2015/08/27 09:36:50, minyue-webrtc wrote: > > On ...
5 years, 3 months ago (2015-08-27 09:47:57 UTC) #14
hlundin-webrtc
Review comments
5 years, 3 months ago (2015-08-27 09:50:42 UTC) #15
hlundin-webrtc
Review comments
5 years, 3 months ago (2015-08-27 09:53:25 UTC) #16
hlundin-webrtc
https://codereview.webrtc.org/1307893004/diff/20001/webrtc/modules/audio_coding/neteq/neteq_impl_unittest.cc File webrtc/modules/audio_coding/neteq/neteq_impl_unittest.cc (right): https://codereview.webrtc.org/1307893004/diff/20001/webrtc/modules/audio_coding/neteq/neteq_impl_unittest.cc#newcode919 webrtc/modules/audio_coding/neteq/neteq_impl_unittest.cc:919: const int kPayloadLengthSamples = 80; On 2015/08/27 08:45:33, Peter ...
5 years, 3 months ago (2015-08-27 09:54:03 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1307893004/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1307893004/60001
5 years, 3 months ago (2015-08-27 09:54:21 UTC) #21
minyue-webrtc
On 2015/08/27 09:44:01, Peter Kasting wrote: > On 2015/08/27 09:36:50, minyue-webrtc wrote: > > On ...
5 years, 3 months ago (2015-08-27 10:30:29 UTC) #22
commit-bot: I haz the power
Try jobs failed on following builders: android on tryserver.webrtc (JOB_TIMED_OUT, no build URL) android_rel on ...
5 years, 3 months ago (2015-08-27 11:54:34 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1307893004/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1307893004/60001
5 years, 3 months ago (2015-08-27 20:14:06 UTC) #26
commit-bot: I haz the power
Committed patchset #3 (id:60001)
5 years, 3 months ago (2015-08-27 20:14:52 UTC) #27
commit-bot: I haz the power
5 years, 3 months ago (2015-08-27 20:15:02 UTC) #28
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/116c84e1b0b7d584a0f04f11de9b2bdb71b25040
Cr-Commit-Position: refs/heads/master@{#9802}

Powered by Google App Engine
This is Rietveld 408576698