summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorgunsch <gunsch@chromium.org>2015-04-30 12:06:54 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-30 19:07:35 +0000
commit4614a4f5597f0ec74bcb59e897b1d1ce4cf4dbea (patch)
tree3935166ad546a752696a228255203e5f82b29e08 /media
parent054861d0934c663de3cea933e1d65fd8319856a6 (diff)
downloadchromium_src-4614a4f5597f0ec74bcb59e897b1d1ce4cf4dbea.zip
chromium_src-4614a4f5597f0ec74bcb59e897b1d1ce4cf4dbea.tar.gz
chromium_src-4614a4f5597f0ec74bcb59e897b1d1ce4cf4dbea.tar.bz2
MediaDrmBridge: only use delegate init data if non-empty.
R=xhwang@chromium.org BUG=None TEST=verified Cast playready test Review URL: https://codereview.chromium.org/1113023004 Cr-Commit-Position: refs/heads/master@{#327756}
Diffstat (limited to 'media')
-rw-r--r--media/base/android/media_drm_bridge.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/media/base/android/media_drm_bridge.cc b/media/base/android/media_drm_bridge.cc
index 7a9aab3..fcb446b 100644
--- a/media/base/android/media_drm_bridge.cc
+++ b/media/base/android/media_drm_bridge.cc
@@ -326,9 +326,11 @@ void MediaDrmBridge::CreateSessionAndGenerateRequest(
&optional_parameters_from_delegate)) {
promise->reject(INVALID_ACCESS_ERROR, 0, "Invalid init data.");
}
- j_init_data = base::android::ToJavaByteArray(
- env, vector_as_array(&init_data_from_delegate),
- init_data_from_delegate.size());
+ if (!init_data_from_delegate.empty()) {
+ j_init_data = base::android::ToJavaByteArray(
+ env, vector_as_array(&init_data_from_delegate),
+ init_data_from_delegate.size());
+ }
if (!optional_parameters_from_delegate.empty()) {
j_optional_parameters = base::android::ToJavaArrayOfStrings(
env, optional_parameters_from_delegate);