Showing the changes to codec/decoder/core/src/au_parser.cpp (1 of 12 files). Show all
Unified · Split
| @@ -264,7 +264,7 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade · 263 unmodified lines | |||
| 264 | case NAL_UNIT_CODED_SLICE_IDR: { | 264 | case NAL_UNIT_CODED_SLICE_IDR: { |
| 265 | PAccessUnit pCurAu = NULL; | 265 | PAccessUnit pCurAu = NULL; |
| 266 | uint32_t uiAvailNalNum; | 266 | uint32_t uiAvailNalNum; |
| 267 | pCurNal = MemGetNextNal (&pCtx->pAccessUnitList); | 267 | pCurNal = MemGetNextNal (&pCtx->pAccessUnitList, pCtx->pMemAlign); |
| 268 | if (NULL == pCurNal) { | 268 | if (NULL == pCurNal) { |
| 269 | WelsLog (pLogCtx, WELS_LOG_ERROR, "MemGetNextNal() fail due out of memory."); | 269 | WelsLog (pLogCtx, WELS_LOG_ERROR, "MemGetNextNal() fail due out of memory."); |
| 270 | pCtx->iErrorCode |= dsOutOfMemory; | 270 | pCtx->iErrorCode |= dsOutOfMemory; |
| @@ -1138,7 +1138,9 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 867 unmodified lines | |||
| 1138 | 1138 | ||
| 1139 | //re-write subset SPS to SPS | 1139 | //re-write subset SPS to SPS |
| 1140 | SBitStringAux sSubsetSpsBs; | 1140 | 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, | ||
| 1142 | "Temp buffer for parse only usage.")); //to reserve 4 bytes for UVLC writing buffer | 1144 | "Temp buffer for parse only usage.")); //to reserve 4 bytes for UVLC writing buffer |
| 1143 | if (NULL == pBsBuf) { | 1145 | if (NULL == pBsBuf) { |
| 1144 | pCtx->iErrorCode |= dsOutOfMemory; | 1146 | pCtx->iErrorCode |= dsOutOfMemory; |
| @@ -1188,7 +1190,7 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 43 unmodified lines | |||
| 1188 | RBSP2EBSP (pSpsBs->pSpsBsBuf + 5, sSubsetSpsBs.pStartBuf, iRbspSize); | 1190 | RBSP2EBSP (pSpsBs->pSpsBsBuf + 5, sSubsetSpsBs.pStartBuf, iRbspSize); |
| 1189 | pSpsBs->uiSpsBsLen = (uint16_t) (sSubsetSpsBs.pCurBuf - sSubsetSpsBs.pStartBuf + 5); | 1191 | pSpsBs->uiSpsBsLen = (uint16_t) (sSubsetSpsBs.pCurBuf - sSubsetSpsBs.pStartBuf + 5); |
| 1190 | if (pBsBuf) { | 1192 | if (pBsBuf) { |
| 1191 | WelsFree (pBsBuf, "pBsBuf for parse only usage"); | 1193 | pMa->WelsFree (pBsBuf, "pBsBuf for parse only usage"); |
| 1192 | } | 1194 | } |
| 1193 | } | 1195 | } |
| 1194 | } | 1196 | } |
| @@ -1572,7 +1574,7 @@ int32_t ResetFmoList (PWelsDecoderContext pCtx) { · 377 unmodified lines | |||
| 1572 | int32_t iCountNum = 0; | 1574 | int32_t iCountNum = 0; |
| 1573 | if (NULL != pCtx) { | 1575 | if (NULL != pCtx) { |
| 1574 | // Fixed memory leak due to PPS_ID might not be continuous sometimes, 1/5/2010 | 1576 | // 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); |
| 1576 | iCountNum = pCtx->iActiveFmoNum; | 1578 | iCountNum = pCtx->iActiveFmoNum; |
| 1577 | pCtx->iActiveFmoNum = 0; | 1579 | pCtx->iActiveFmoNum = 0; |
| 1578 | } | 1580 | } |