History

add dec memory check

huili2 committed 11 years ago

Commit 3cb417f1 parent 9ecc67112 files · +196 −141Browse files

Showing the changes to codec/decoder/core/src/au_parser.cpp (1 of 12 files). Show all

Unified · Split

codec/decoder/core/src/au_parser.cpp+6−4
@@ -264,7 +264,7 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade · 263 unmodified lines
264264 case NAL_UNIT_CODED_SLICE_IDR: {
265265 PAccessUnit pCurAu = NULL;
266266 uint32_t uiAvailNalNum;
267− pCurNal = MemGetNextNal (&pCtx->pAccessUnitList);
267+ pCurNal = MemGetNextNal (&pCtx->pAccessUnitList, pCtx->pMemAlign);
268268 if (NULL == pCurNal) {
269269 WelsLog (pLogCtx, WELS_LOG_ERROR, "MemGetNextNal() fail due out of memory.");
270270 pCtx->iErrorCode |= dsOutOfMemory;
@@ -1138,7 +1138,9 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 867 unmodified lines
11381138
11391139 //re-write subset SPS to SPS
11401140 SBitStringAux sSubsetSpsBs;
1141− uint8_t* pBsBuf = static_cast<uint8_t*> (WelsMallocz (SPS_PPS_BS_SIZE + 4,
1141+ CMemoryAlign* pMa = pCtx->pMemAlign;
1142+
1143+ uint8_t* pBsBuf = static_cast<uint8_t*> (pMa->WelsMallocz (SPS_PPS_BS_SIZE + 4,
11421144 "Temp buffer for parse only usage.")); //to reserve 4 bytes for UVLC writing buffer
11431145 if (NULL == pBsBuf) {
11441146 pCtx->iErrorCode |= dsOutOfMemory;
@@ -1188,7 +1190,7 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 43 unmodified lines
11881190 RBSP2EBSP (pSpsBs->pSpsBsBuf + 5, sSubsetSpsBs.pStartBuf, iRbspSize);
11891191 pSpsBs->uiSpsBsLen = (uint16_t) (sSubsetSpsBs.pCurBuf - sSubsetSpsBs.pStartBuf + 5);
11901192 if (pBsBuf) {
1191− WelsFree (pBsBuf, "pBsBuf for parse only usage");
1193+ pMa->WelsFree (pBsBuf, "pBsBuf for parse only usage");
11921194 }
11931195 }
11941196 }
@@ -1572,7 +1574,7 @@ int32_t ResetFmoList (PWelsDecoderContext pCtx) { · 377 unmodified lines
15721574 int32_t iCountNum = 0;
15731575 if (NULL != pCtx) {
15741576 // Fixed memory leak due to PPS_ID might not be continuous sometimes, 1/5/2010
1575− UninitFmoList (&pCtx->sFmoList[0], MAX_PPS_COUNT, pCtx->iActiveFmoNum);
1577+ UninitFmoList (&pCtx->sFmoList[0], MAX_PPS_COUNT, pCtx->iActiveFmoNum, pCtx->pMemAlign);
15761578 iCountNum = pCtx->iActiveFmoNum;
15771579 pCtx->iActiveFmoNum = 0;
15781580 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t