Commit 23a93bfe authored by chcunningham's avatar chcunningham Committed by Commit bot

Adding defensive CHECKs for AudioDecoderConfig crash

Top frames of the crash stack don't make much sense. Checking the
obvious sources of memory access issues.

BUG=715761

Review-Url: https://codereview.chromium.org/2856633002
Cr-Commit-Position: refs/heads/master@{#468435}
parent 3e31774e
......@@ -284,12 +284,16 @@ DemuxerStream::Liveness ChunkDemuxerStream::liveness() const {
AudioDecoderConfig ChunkDemuxerStream::audio_decoder_config() {
CHECK_EQ(type_, AUDIO);
base::AutoLock auto_lock(lock_);
// Trying to track down crash. http://crbug.com/715761
CHECK(stream_);
return stream_->GetCurrentAudioDecoderConfig();
}
VideoDecoderConfig ChunkDemuxerStream::video_decoder_config() {
CHECK_EQ(type_, VIDEO);
base::AutoLock auto_lock(lock_);
// Trying to track down crash. http://crbug.com/715761
CHECK(stream_);
return stream_->GetCurrentVideoDecoderConfig();
}
......
......@@ -1551,12 +1551,18 @@ bool SourceBufferStream::IsEndOfStreamReached() const {
const AudioDecoderConfig& SourceBufferStream::GetCurrentAudioDecoderConfig() {
if (config_change_pending_)
CompleteConfigChange();
// Trying to track down crash. http://crbug.com/715761
CHECK(current_config_index_ >= 0 &&
static_cast<size_t>(current_config_index_) < audio_configs_.size());
return audio_configs_[current_config_index_];
}
const VideoDecoderConfig& SourceBufferStream::GetCurrentVideoDecoderConfig() {
if (config_change_pending_)
CompleteConfigChange();
// Trying to track down crash. http://crbug.com/715761
CHECK(current_config_index_ >= 0 &&
static_cast<size_t>(current_config_index_) < video_configs_.size());
return video_configs_[current_config_index_];
}
......
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