summaryrefslogtreecommitdiffstats
path: root/libvideoeditor
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2012-01-27 15:38:44 -0800
committerJames Dong <jdong@google.com>2012-01-27 15:45:51 -0800
commitc84b947d802116d64ca11087cfbc52fabd3c7109 (patch)
tree4391ee289c70f0043642931adbc330203ec019ae /libvideoeditor
parent5ddfbe7a9c530f70582dc788c9b198d892be3950 (diff)
downloadframeworks_av-c84b947d802116d64ca11087cfbc52fabd3c7109.zip
frameworks_av-c84b947d802116d64ca11087cfbc52fabd3c7109.tar.gz
frameworks_av-c84b947d802116d64ca11087cfbc52fabd3c7109.tar.bz2
Fix an error to deal with 0-size nal units in some AVC files
o related-to-bug: 5890998 Change-Id: If0198e52ff7bbd7422f219f55a37aae97f7d74f1
Diffstat (limited to 'libvideoeditor')
-rwxr-xr-xlibvideoeditor/vss/mcs/src/M4MCS_API.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/libvideoeditor/vss/mcs/src/M4MCS_API.c b/libvideoeditor/vss/mcs/src/M4MCS_API.c
index 3844630..c056ef0 100755
--- a/libvideoeditor/vss/mcs/src/M4MCS_API.c
+++ b/libvideoeditor/vss/mcs/src/M4MCS_API.c
@@ -1337,21 +1337,8 @@ M4OSA_ERR H264MCS_ProcessSPS_PPS( NSWAVC_MCS_t *instance, M4OSA_UInt8 *inbuff,
M4OSA_DEBUG_IF2((M4OSA_NULL == instance), M4ERR_PARAMETER,
"H264MCS_ProcessSPS_PPS: instance is M4OSA_NULL");
- switch( instance->m_pDecoderSpecificInfo[4] & 0x3 )
- {
- case 0:
- instance->m_Num_Bytes_NALUnitLength = 1;
- break;
-
- case 1:
- instance->m_Num_Bytes_NALUnitLength = 2;
- break;
-
- case 3:
- //Note: Current code supports only this...
- instance->m_Num_Bytes_NALUnitLength = 4;
- break;
- }
+ instance->m_Num_Bytes_NALUnitLength =
+ (instance->m_pDecoderSpecificInfo[4] & 0x03) + 1;
instance->m_encoder_SPS_Cnt = instance->m_pDecoderSpecificInfo[5] & 0x1F;
@@ -1428,6 +1415,12 @@ M4OSA_ERR H264MCS_ProcessSPS_PPS( NSWAVC_MCS_t *instance, M4OSA_UInt8 *inbuff,
break;
}
+ if (nal_size == 0) {
+ M4OSA_TRACE1_1("0 size nal unit at line %d", __LINE__);
+ frame_size += instance->m_Num_Bytes_NALUnitLength;
+ continue;
+ }
+
p_bs->bitPos = 0;
p_bs->lastTotalBits = 0;
p_bs->numBitsInBuffer =