Merge "Fix C++11 Narrowing Errors in WVDrmPlugin"

This commit is contained in:
John "Juce" Bruce
2015-03-09 19:03:11 +00:00
committed by Android (Google) Code Review
2 changed files with 3 additions and 4 deletions

View File

@@ -1,8 +1,6 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_CLANG_CFLAGS += -Wno-error=c++11-narrowing
LOCAL_SRC_FILES := \
src/WVDrmPlugin.cpp \
src/WVGenericCryptoInterface.cpp \

View File

@@ -170,7 +170,7 @@ status_t WVDrmPlugin::getKeyRequest(
!InitDataResemblesPSSH(initData)) {
// This data was passed in the old format, pre-unwrapped. We need to wrap
// the init data in a new PSSH header.
static const char psshPrefix[] = {
static const uint8_t psshPrefix[] = {
0, 0, 0, 0, // Total size
'p', 's', 's', 'h', // "PSSH"
0, 0, 0, 0, // Flags - must be zero
@@ -178,7 +178,8 @@ status_t WVDrmPlugin::getKeyRequest(
0xA3, 0xC8, 0x27, 0xDC, 0xD5, 0x1D, 0x21, 0xED,
0, 0, 0, 0 // Size of initData
};
processedInitData.assign(psshPrefix, sizeof(psshPrefix) / sizeof(char));
processedInitData.assign(reinterpret_cast<const char*>(psshPrefix),
sizeof(psshPrefix) / sizeof(uint8_t));
processedInitData.append(reinterpret_cast<const char*>(initData.array()),
initData.size());
const size_t kPsshBoxSizeLocation = 0;