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

Unified Diff: media/base/android/media_drm_bridge.cc

Issue 1113023004: MediaDrmBridge: only use delegate init data if non-empty. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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/android/media_drm_bridge.cc
diff --git a/media/base/android/media_drm_bridge.cc b/media/base/android/media_drm_bridge.cc
index 7a9aab3aa5a7e40f4c6d6f7a8098a219890701f1..fcb446b28b21255ee0bea4dbccd99b5deb7ce6a4 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);
« 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