summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanny Fernandes <dannyfernandes@google.com>2011-02-16 12:03:02 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-02-16 12:03:02 -0800
commitd9839024c67add85cf8300713ad1c6367e1a214c (patch)
tree8e253ece96c7c9960fe1aee72b238e389da4e82b
parentc3e1e1e4207a655bf5a3ecf9b9e41700e54a3c86 (diff)
parentf21b91e7e6ba0de65a64b556224e7985113eeb67 (diff)
downloadframeworks_av-d9839024c67add85cf8300713ad1c6367e1a214c.zip
frameworks_av-d9839024c67add85cf8300713ad1c6367e1a214c.tar.gz
frameworks_av-d9839024c67add85cf8300713ad1c6367e1a214c.tar.bz2
Merge "Fix issue 3457629 FIle loads but does not play"
-rwxr-xr-xlibvideoeditor/vss/src/M4VD_EXTERNAL_BitstreamParser.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/libvideoeditor/vss/src/M4VD_EXTERNAL_BitstreamParser.c b/libvideoeditor/vss/src/M4VD_EXTERNAL_BitstreamParser.c
index bc75488..1d8c1cd 100755
--- a/libvideoeditor/vss/src/M4VD_EXTERNAL_BitstreamParser.c
+++ b/libvideoeditor/vss/src/M4VD_EXTERNAL_BitstreamParser.c
@@ -503,18 +503,21 @@ M4OSA_ERR M4DECODER_EXTERNAL_ParseAVCDSI(M4OSA_UInt8* pDSI, M4OSA_Int32 DSISize,
{
M4OSA_ERR err = M4NO_ERROR;
M4OSA_Bool NALSPS_and_Profile0Found = M4OSA_FALSE;
- M4OSA_UInt16 index;
- M4OSA_Bool constraintSet3;
+ M4OSA_UInt16 index = 28; /* the 29th byte is SPS start */
+ M4OSA_Bool constraintSet3;
+
+ if (DSISize <= index) {
+ M4OSA_TRACE1_0("M4DECODER_EXTERNAL_ParseAVCDSI: DSI is invalid");
+ *profile = M4DECODER_AVC_kProfile_and_Level_Out_Of_Range;
+ return M4ERR_PARAMETER;
+ }
/* check for baseline profile */
- for(index = 0; index < (DSISize-1); index++)
+ if(((pDSI[index] & 0x1f) == 0x07) && (pDSI[index+1] == 0x42))
{
- if(((pDSI[index] & 0x1f) == 0x07) && (pDSI[index+1] == 0x42))
- {
- NALSPS_and_Profile0Found = M4OSA_TRUE;
- break;
- }
+ NALSPS_and_Profile0Found = M4OSA_TRUE;
}
+
if(M4OSA_FALSE == NALSPS_and_Profile0Found)
{
M4OSA_TRACE1_1("M4DECODER_EXTERNAL_ParseAVCDSI: index bad = %d", index);