From 1ff36eb21762de691ff6da86963aeee854a2334b Mon Sep 17 00:00:00 2001 From: Thomas Inskip Date: Mon, 8 Sep 2014 11:43:25 -0700 Subject: [PATCH] Fix for decryption unit test break. Change-Id: I4da3956f25fae2738fac9d0e3a8e8f597836d3a3 --- media/base/key_source.cc | 3 ++- media/test/packager_test.cc | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) 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());