aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhding3 <haitao.ding@intel.com>2014-11-26 18:41:55 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-11-26 18:41:55 +0000
commit8eb37ff1d95960ec7ca06d1ed904a43b86791245 (patch)
treea9bbd7c2d82d06e5537c4e06465a9dbdd12ad73a
parent362e5c9b5098f12375806c3e32e5f7260e92371b (diff)
parentc75124d4c9d14ad647748a7ff216567f184f150e (diff)
downloadlibmix-8eb37ff1d95960ec7ca06d1ed904a43b86791245.tar.gz
am c75124d4: [libmix] Work around to handle wrong packed buffer
* commit 'c75124d4c9d14ad647748a7ff216567f184f150e': [libmix] Work around to handle wrong packed buffer
-rw-r--r--videodecoder/securevideo/moorefield/VideoDecoderAVCSecure.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/videodecoder/securevideo/moorefield/VideoDecoderAVCSecure.cpp b/videodecoder/securevideo/moorefield/VideoDecoderAVCSecure.cpp
index b124832..4260f30 100644
--- a/videodecoder/securevideo/moorefield/VideoDecoderAVCSecure.cpp
+++ b/videodecoder/securevideo/moorefield/VideoDecoderAVCSecure.cpp
@@ -149,6 +149,16 @@ Decode_Status VideoDecoderAVCSecure::processModularInputBuffer(VideoDecodeBuffer
VTRACE("nalu_type = 0x%x, nalu_size = %d, nalu_offset = 0x%x", nalu_type, nalu_size, nalu_offset);
+ // FIXME: this is a w/a to handle the case when two frame data was wrongly packed into one buffer
+ // especially IDR + Slice. let it gracefully quit.
+ if ((naluType == h264_NAL_UNIT_TYPE_SLICE) && (i > 0)) {
+ uint8_t former_naluType = pFrameInfo->nalus[i-1].type & NALU_TYPE_MASK;
+ if (former_naluType == h264_NAL_UNIT_TYPE_IDR) {
+ ETRACE("Invalid parameter: IDR slice + SLICE in one buffer");
+ break; // abandon this slice
+ }
+ }
+
if (naluType >= h264_NAL_UNIT_TYPE_SLICE && naluType <= h264_NAL_UNIT_TYPE_IDR) {
mIsEncryptData = 1;