diff options
author | Danny Fernandes <dannyfernandes@google.com> | 2011-02-16 11:22:49 -0800 |
---|---|---|
committer | Danny Fernandes <dannyfernandes@google.com> | 2011-02-16 11:49:36 -0800 |
commit | f21b91e7e6ba0de65a64b556224e7985113eeb67 (patch) | |
tree | 3d4c3b38f7a33f767897357a94b0b20fe5f0f423 | |
parent | c083500e41973256e0c3d4faf5948916b64e918e (diff) | |
download | frameworks_av-f21b91e7e6ba0de65a64b556224e7985113eeb67.zip frameworks_av-f21b91e7e6ba0de65a64b556224e7985113eeb67.tar.gz frameworks_av-f21b91e7e6ba0de65a64b556224e7985113eeb67.tar.bz2 |
Fix issue 3457629 FIle loads but does not play
Change-Id: Id4f77d3883b0f6ad6ffd75ddac49efd5cf2ca1c7
-rwxr-xr-x | libvideoeditor/vss/src/M4VD_EXTERNAL_BitstreamParser.c | 19 |
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); |