diff options
author | hding3 <haitao.ding@intel.com> | 2014-11-25 09:23:23 +0800 |
---|---|---|
committer | Ed Tam <etam@google.com> | 2014-11-26 01:10:37 +0000 |
commit | c75124d4c9d14ad647748a7ff216567f184f150e (patch) | |
tree | 5689b98d7ae06ad3b8aa3a4c29e4a3f5986e0375 /videodecoder/securevideo | |
parent | 7a80fb59f855261ef39344d6fe91a695cfc05b59 (diff) | |
download | libmix-c75124d4c9d14ad647748a7ff216567f184f150e.tar.gz |
[libmix] Work around to handle wrong packed buffer
Wrongly packed buffers have both IDR + SLICE inside
simultaneously. Let it quit gracefully rather than
lead to VED hang and reboot.
Bug: 17656112
Bug: 18306960
Change-Id: I89092ec5c2770c9e957dc7cd90910a7567aa2507
Signed-off-by: hding3 <haitao.ding@intel.com>
Diffstat (limited to 'videodecoder/securevideo')
-rw-r--r-- | videodecoder/securevideo/moorefield/VideoDecoderAVCSecure.cpp | 10 |
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; |