diff --git a/media/base/key_source.cc b/media/base/key_source.cc index c1293311f3..245d5e8199 100644 --- a/media/base/key_source.cc +++ b/media/base/key_source.cc @@ -79,7 +79,8 @@ scoped_ptr KeySource::CreateFromHexStrings( } std::vector pssh_data; - if (!base::HexStringToBytes(pssh_data_hex, &pssh_data)) { + if (!pssh_data_hex.empty() && + !base::HexStringToBytes(pssh_data_hex, &pssh_data)) { LOG(ERROR) << "Cannot parse pssh_hex " << pssh_data_hex; return scoped_ptr(); } diff --git a/media/test/packager_test.cc b/media/test/packager_test.cc index a075fd349e..93f9eef818 100644 --- a/media/test/packager_test.cc +++ b/media/test/packager_test.cc @@ -203,7 +203,7 @@ void PackagerTestBasic::Decrypt(const std::string& input, Demuxer demuxer(GetFullPath(input)); scoped_ptr decryption_key_source( KeySource::CreateFromHexStrings(kKeyIdHex, kKeyHex, "", "")); - DCHECK(decryption_key_source); + ASSERT_TRUE(decryption_key_source); demuxer.SetKeySource(decryption_key_source.Pass()); ASSERT_OK(demuxer.Initialize());