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

Unified Diff: media/base/audio_discard_helper.cc

Issue 2884383003: Replace DCHECK with conditional and error. (Closed)
Patch Set: Created 3 years, 7 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/base/audio_discard_helper.cc
diff --git a/media/base/audio_discard_helper.cc b/media/base/audio_discard_helper.cc
index e932c44ab58c43026e5c9208960998c637c7bf0c..2929e6e430dc016a12ff8f0bed34216bcf563446 100644
--- a/media/base/audio_discard_helper.cc
+++ b/media/base/audio_discard_helper.cc
@@ -194,7 +194,10 @@ bool AudioDiscardHelper::ProcessBuffers(
if (decoder_delay_) {
// Delayed end discard only works if the decoder delay is less than a
// single buffer.
- DCHECK_LT(decoder_delay_, original_frame_count);
+ if (decoder_delay_ >= original_frame_count) {
+ DLOG(ERROR) << "Encountered invalid discard padding value.";
+ return false;
+ }
// If the discard is >= the decoder delay, trim everything we can off the
// end of this buffer and the rest from the start of the next.
« 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