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

Unified Diff: media/filters/audio_file_reader.cc

Issue 10821029: Moved DCHECK() to prevent NULL deref of codec_context_. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/audio_file_reader.cc
diff --git a/media/filters/audio_file_reader.cc b/media/filters/audio_file_reader.cc
index 706a9aac45b727c18c7639b7905e7543a68c102a..a2d0c6839934519b7adf77a083178c45d9ef14bc 100644
--- a/media/filters/audio_file_reader.cc
+++ b/media/filters/audio_file_reader.cc
@@ -112,12 +112,13 @@ void AudioFileReader::Close() {
bool AudioFileReader::Read(const std::vector<float*>& audio_data,
size_t number_of_frames) {
+ DCHECK(format_context_ && codec_context_ && codec_);
+
size_t channels = this->channels();
DCHECK_EQ(audio_data.size(), channels);
if (audio_data.size() != channels)
return false;
- DCHECK(format_context_ && codec_context_ && codec_);
if (!format_context_ || !codec_context_ || !codec_) {
Tyler Breisacher (Chromium) 2012/07/25 21:53:03 Isn't if () redundant then? Maybe it should just s
Kyle Horimoto 2012/07/25 21:57:25 If we did that, we wouldn't hit the "return false;
Tyler Breisacher (Chromium) 2012/07/25 22:14:23 The DCHECK is saying "none of these should ever be
DLOG(WARNING) << "AudioFileReader::Read() : reader is not opened!";
return false;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698