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

Issue 1453233002: Improve input handling for WaveAudioHandler. (Closed)

Created:
5 years, 1 month ago by slan
Modified:
5 years, 1 month ago
CC:
chromium-reviews, feature-media-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Improve input handling for WaveAudioHandler. Improperly-formatted WAV data causes this class to attempt to divide by zero in the constructor. Check for this condition, and invalidate internal state if the WAV data does not parse properly. It should be able to accept any data without crashing. Add unittests to verify. Bug: b/21759728 BUG= TEST=wav_audio_handler_unittest.cc Committed: https://crrev.com/344528fe16c4daf1d34bd59e09fc8e07d12a27f4 Cr-Commit-Position: refs/heads/master@{#361147}

Patch Set 1 #

Patch Set 2 : Correct typo #

Total comments: 8

Patch Set 3 : Remove is_valid_ #

Patch Set 4 : Add factory method for WavAudioHandler #

Patch Set 5 : Remove VLOG()s #

Total comments: 6

Patch Set 6 : Address nits. #

Patch Set 7 : More comments, more test cases. #

Total comments: 14

Patch Set 8 : Address comments #

Total comments: 2

Patch Set 9 : Update FileSource #

Total comments: 6

Patch Set 10 : Address comments. #

Patch Set 11 : clean-up #

Patch Set 12 : Export FileSource for component build + rebase #

Patch Set 13 : Allow tests to build on Win #

Patch Set 14 : Formatting #

Unified diffs Side-by-side diffs Delta from patch set Stats (+532 lines, -174 lines) Patch
M chrome/browser/media/webrtc_browsertest_audio.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +9 lines, -22 lines 0 comments Download
M media/audio/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -1 line 0 comments Download
M media/audio/simple_sources.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +8 lines, -3 lines 0 comments Download
M media/audio/simple_sources.cc View 1 2 3 4 5 6 7 8 9 10 4 chunks +22 lines, -25 lines 0 comments Download
M media/audio/simple_sources_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +102 lines, -0 lines 0 comments Download
M media/audio/sounds/audio_stream_handler.h View 1 2 3 4 5 6 7 8 9 3 chunks +4 lines, -5 lines 0 comments Download
M media/audio/sounds/audio_stream_handler.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 7 chunks +42 lines, -21 lines 0 comments Download
M media/audio/sounds/audio_stream_handler_unittest.cc View 1 2 3 4 5 6 7 3 chunks +17 lines, -0 lines 0 comments Download
M media/audio/sounds/sounds_manager.cc View 1 2 3 4 5 6 7 2 chunks +4 lines, -13 lines 0 comments Download
M media/audio/sounds/test_data.h View 1 2 3 4 5 6 7 8 9 3 chunks +6 lines, -4 lines 0 comments Download
M media/audio/sounds/wav_audio_handler.h View 1 2 3 4 5 6 7 8 9 3 chunks +20 lines, -15 lines 0 comments Download
M media/audio/sounds/wav_audio_handler.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +128 lines, -49 lines 0 comments Download
M media/audio/sounds/wav_audio_handler_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +168 lines, -15 lines 0 comments Download
M media/media.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 38 (11 generated)
slan
Hey all, Chromecast is having an issue in the ctor of WavAudioHandler. Add more robust ...
5 years, 1 month ago (2015-11-17 19:59:10 UTC) #2
tommi (sloooow) - chröme
https://codereview.chromium.org/1453233002/diff/20001/media/audio/sounds/wav_audio_handler.cc File media/audio/sounds/wav_audio_handler.cc (right): https://codereview.chromium.org/1453233002/diff/20001/media/audio/sounds/wav_audio_handler.cc#newcode86 media/audio/sounds/wav_audio_handler.cc:86: if (num_channels_ == 0u || bits_per_sample_ == 0u || ...
5 years, 1 month ago (2015-11-17 20:48:39 UTC) #3
slan
https://codereview.chromium.org/1453233002/diff/20001/media/audio/sounds/wav_audio_handler.cc File media/audio/sounds/wav_audio_handler.cc (right): https://codereview.chromium.org/1453233002/diff/20001/media/audio/sounds/wav_audio_handler.cc#newcode86 media/audio/sounds/wav_audio_handler.cc:86: if (num_channels_ == 0u || bits_per_sample_ == 0u || ...
5 years, 1 month ago (2015-11-17 21:50:16 UTC) #4
tommi (sloooow) - chröme
https://codereview.chromium.org/1453233002/diff/20001/media/audio/sounds/wav_audio_handler.cc File media/audio/sounds/wav_audio_handler.cc (right): https://codereview.chromium.org/1453233002/diff/20001/media/audio/sounds/wav_audio_handler.cc#newcode103 media/audio/sounds/wav_audio_handler.cc:103: return is_valid_ ? data_.size() <= cursor : true; On ...
5 years, 1 month ago (2015-11-18 11:52:58 UTC) #5
slan
Factory method is implemented, and most data members in WavAudioHandler are now const. PTAL
5 years, 1 month ago (2015-11-18 22:00:04 UTC) #6
wzhong
https://codereview.chromium.org/1453233002/diff/80001/media/audio/sounds/wav_audio_handler.cc File media/audio/sounds/wav_audio_handler.cc (right): https://codereview.chromium.org/1453233002/diff/80001/media/audio/sounds/wav_audio_handler.cc#newcode74 media/audio/sounds/wav_audio_handler.cc:74: DLOG(ERROR) << "Data size " << data.size() << " ...
5 years, 1 month ago (2015-11-18 22:21:35 UTC) #7
slan
Added a few more comments and more test cases. https://codereview.chromium.org/1453233002/diff/80001/media/audio/sounds/wav_audio_handler.cc File media/audio/sounds/wav_audio_handler.cc (right): https://codereview.chromium.org/1453233002/diff/80001/media/audio/sounds/wav_audio_handler.cc#newcode74 media/audio/sounds/wav_audio_handler.cc:74: ...
5 years, 1 month ago (2015-11-19 00:19:44 UTC) #8
wzhong
lgtm
5 years, 1 month ago (2015-11-19 01:07:40 UTC) #9
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1453233002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1453233002/120001
5 years, 1 month ago (2015-11-19 02:00:43 UTC) #11
commit-bot: I haz the power
Dry run: No L-G-T-M from a valid reviewer yet. Only full committers are accepted. Even ...
5 years, 1 month ago (2015-11-19 02:00:44 UTC) #13
tommi (sloooow) - chröme
https://codereview.chromium.org/1453233002/diff/120001/media/audio/simple_sources.cc File media/audio/simple_sources.cc (right): https://codereview.chromium.org/1453233002/diff/120001/media/audio/simple_sources.cc#newcode173 media/audio/simple_sources.cc:173: reinterpret_cast<const char*>(wav_file_data_.get()), file_length)); hmm... I guess shared_ptr could have ...
5 years, 1 month ago (2015-11-19 09:44:06 UTC) #14
slan
Okay, added some more tests and addressed comments. PTAL. https://codereview.chromium.org/1453233002/diff/120001/media/audio/simple_sources.cc File media/audio/simple_sources.cc (right): https://codereview.chromium.org/1453233002/diff/120001/media/audio/simple_sources.cc#newcode173 media/audio/simple_sources.cc:173: ...
5 years, 1 month ago (2015-11-19 18:57:16 UTC) #15
slan
https://codereview.chromium.org/1453233002/diff/120001/media/audio/simple_sources.cc File media/audio/simple_sources.cc (right): https://codereview.chromium.org/1453233002/diff/120001/media/audio/simple_sources.cc#newcode173 media/audio/simple_sources.cc:173: reinterpret_cast<const char*>(wav_file_data_.get()), file_length)); On 2015/11/19 18:57:16, slan wrote: > ...
5 years, 1 month ago (2015-11-19 19:05:27 UTC) #16
tommi (sloooow) - chröme
Lots of really good changes :) If you have time to do the ownership change ...
5 years, 1 month ago (2015-11-20 09:45:23 UTC) #17
DaleCurtis
https://codereview.chromium.org/1453233002/diff/160001/media/audio/simple_sources.cc File media/audio/simple_sources.cc (right): https://codereview.chromium.org/1453233002/diff/160001/media/audio/simple_sources.cc#newcode48 media/audio/simple_sources.cc:48: data_out->set(data.release(), wav_file_length); On 2015/11/20 09:45:23, tommi wrote: > how ...
5 years, 1 month ago (2015-11-20 17:31:39 UTC) #19
tommi (sloooow) - chröme
https://codereview.chromium.org/1453233002/diff/160001/media/audio/simple_sources.cc File media/audio/simple_sources.cc (right): https://codereview.chromium.org/1453233002/diff/160001/media/audio/simple_sources.cc#newcode48 media/audio/simple_sources.cc:48: data_out->set(data.release(), wav_file_length); On 2015/11/20 17:31:39, DaleCurtis wrote: > On ...
5 years, 1 month ago (2015-11-20 18:01:27 UTC) #20
slan
I've addressed some of the comments. I actually implemented passing ownership of the data into ...
5 years, 1 month ago (2015-11-20 18:09:37 UTC) #21
tommi (sloooow) - chröme
lgtm! Thanks for going above and beyond on this one :)
5 years, 1 month ago (2015-11-20 19:54:23 UTC) #22
slan
On 2015/11/20 19:54:23, tommi wrote: > lgtm! Thanks for going above and beyond on this ...
5 years, 1 month ago (2015-11-20 20:03:33 UTC) #23
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1453233002/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1453233002/200001
5 years, 1 month ago (2015-11-20 20:05:11 UTC) #25
DaleCurtis
Deferring to tommi@ for main review, lgtm for simple_sources and media.gyp
5 years, 1 month ago (2015-11-20 20:18:50 UTC) #26
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/120826)
5 years, 1 month ago (2015-11-20 20:19:49 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1453233002/220001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1453233002/220001
5 years, 1 month ago (2015-11-22 23:47:02 UTC) #31
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/121153)
5 years, 1 month ago (2015-11-22 23:54:59 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1453233002/260001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1453233002/260001
5 years, 1 month ago (2015-11-23 17:11:17 UTC) #36
commit-bot: I haz the power
Committed patchset #14 (id:260001)
5 years, 1 month ago (2015-11-23 19:22:46 UTC) #37
commit-bot: I haz the power
5 years, 1 month ago (2015-11-23 19:23:26 UTC) #38
Message was sent while issue was closed.
Patchset 14 (id:??) landed as
https://crrev.com/344528fe16c4daf1d34bd59e09fc8e07d12a27f4
Cr-Commit-Position: refs/heads/master@{#361147}

Powered by Google App Engine
This is Rietveld 408576698