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

Unified Diff: media/filters/decrypting_audio_decoder.cc

Issue 17422002: Encrypted Media: DecryptingXxx::SetDecryptor() accepts NULL decryptor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add todo and bug. Created 7 years, 6 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 | media/filters/decrypting_audio_decoder_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/decrypting_audio_decoder.cc
diff --git a/media/filters/decrypting_audio_decoder.cc b/media/filters/decrypting_audio_decoder.cc
index f908d9b504cb4ddaa09743c7c02b767973ec90cc..8aee1411ef7336aef8e871da8fe917d2ee16680c 100644
--- a/media/filters/decrypting_audio_decoder.cc
+++ b/media/filters/decrypting_audio_decoder.cc
@@ -173,6 +173,14 @@ void DecryptingAudioDecoder::SetDecryptor(Decryptor* decryptor) {
DCHECK(!set_decryptor_ready_cb_.is_null());
set_decryptor_ready_cb_.Reset();
+
+ if (!decryptor) {
+ base::ResetAndReturn(&init_cb_).Run(DECODER_ERROR_NOT_SUPPORTED);
+ // TODO(xhwang): Add kError state. See http://crbug.com/251503
+ state_ = kDecodeFinished;
+ return;
+ }
+
decryptor_ = decryptor;
const AudioDecoderConfig& input_config =
« no previous file with comments | « no previous file | media/filters/decrypting_audio_decoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698