aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHyunchang Choi <hyunchang.choi@intel.com>2016-03-31 00:35:58 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-03-31 00:35:58 +0000
commit09a88e9e53c71693bae911dd7e82079610c39dcc (patch)
tree8a2d2ab389c0cce0b3fc5338ee460406a7954060
parente1569e56a264e55206110ff8010b6ccfab41e090 (diff)
parentc5f578fb8ed322ee730a31c50c3778e8af9204b7 (diff)
downloadlibmix-09a88e9e53c71693bae911dd7e82079610c39dcc.tar.gz
media hardening: OMX::allocateBuffer must return protected buffers as native_handles
am: c5f578f * commit 'c5f578fb8ed322ee730a31c50c3778e8af9204b7': media hardening: OMX::allocateBuffer must return protected buffers as native_handles Change-Id: I47de63210ff9fa8bad035d223bcc96b1affd5231
-rwxr-xr-x[-rw-r--r--]videodecoder/securevideo/moorefield/VideoDecoderAVCSecure.cpp8
-rwxr-xr-xvideodecoder/securevideo/moorefield/VideoFrameInfo.h2
2 files changed, 6 insertions, 4 deletions
diff --git a/videodecoder/securevideo/moorefield/VideoDecoderAVCSecure.cpp b/videodecoder/securevideo/moorefield/VideoDecoderAVCSecure.cpp
index bdb0099..8579fed 100644..100755
--- a/videodecoder/securevideo/moorefield/VideoDecoderAVCSecure.cpp
+++ b/videodecoder/securevideo/moorefield/VideoDecoderAVCSecure.cpp
@@ -129,7 +129,7 @@ Decode_Status VideoDecoderAVCSecure::processModularInputBuffer(VideoDecodeBuffer
return DECODE_MEMORY_FAIL;
}
- mFrameData = pFrameInfo->data;
+ mFrameData = (uint8_t *)pFrameInfo + pFrameInfo->data_offset_from_frameinfo;
mFrameSize = pFrameInfo->size;
VTRACE("mFrameData = %p, mFrameSize = %d", mFrameData, mFrameSize);
@@ -146,7 +146,7 @@ Decode_Status VideoDecoderAVCSecure::processModularInputBuffer(VideoDecodeBuffer
nalu_size = pFrameInfo->nalus[i].length;
nalu_type = pFrameInfo->nalus[i].type;
nalu_offset = pFrameInfo->nalus[i].offset;
- nalu_data = pFrameInfo->nalus[i].data;
+ nalu_data = ((uint8_t *)pFrameInfo) + pFrameInfo->nalus[i].data_offset_from_frameinfo;
naluType = nalu_type & NALU_TYPE_MASK;
VTRACE("nalu_type = 0x%x, nalu_size = %d, nalu_offset = 0x%x", nalu_type, nalu_size, nalu_offset);
@@ -208,8 +208,8 @@ Decode_Status VideoDecoderAVCSecure::processModularInputBuffer(VideoDecodeBuffer
VTRACE("Decoding clear video ...");
mIsEncryptData = 0;
mFrameSize = buffer->size;
- mFrameData = buffer->data;
- clear_data = buffer->data;
+ mFrameData = (uint8_t *)pFrameInfo + (int)pFrameInfo->data_offset_from_frameinfo;
+ clear_data = (uint8_t *)pFrameInfo + (int)pFrameInfo->data_offset_from_frameinfo;
clear_data_size = buffer->size;
}
diff --git a/videodecoder/securevideo/moorefield/VideoFrameInfo.h b/videodecoder/securevideo/moorefield/VideoFrameInfo.h
index 485b0da..d7584f8 100755
--- a/videodecoder/securevideo/moorefield/VideoFrameInfo.h
+++ b/videodecoder/securevideo/moorefield/VideoFrameInfo.h
@@ -23,11 +23,13 @@ typedef struct {
uint8_t type; // nalu type + nal_ref_idc
uint32_t offset; // offset to the pointer of the encrypted data
uint8_t* data; // if the nalu is encrypted, this field is useless; if current NALU is SPS/PPS, data is the pointer to clear SPS/PPS data
+ uint32_t data_offset_from_frameinfo; // offset from frame_info to data. this will be used instead of data for inter-process
uint32_t length; // nalu length
} nalu_info_t;
typedef struct {
uint8_t* data; // pointer to the encrypted data
+ uint32_t data_offset_from_frameinfo; // offset from frame_info to data. this will be used instead of data for inter-process
uint32_t size; // encrypted data size
uint32_t num_nalus; // number of NALU
nalu_info_t nalus[MAX_NUM_NALUS];