Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 8 files). Show all
Unified · Split
| @@ -4839,6 +4839,17 @@ int32_t DynSliceRealloc (sWelsEncCtx* pCtx, · 4838 unmodified lines | ||
| 4839 | 4839 | pMA->WelsFree (pCurLayer->pSliceEncCtx->pCountMbNumInSlice, "pSliceSeg->pCountMbNumInSlice"); |
| 4840 | 4840 | pCurLayer->pSliceEncCtx->pCountMbNumInSlice = pCountMbNumInSlice; |
| 4841 | 4841 | |
| 4842 | + uint32_t* pSliceConsumeTime = (uint32_t*)pMA->WelsMalloc (iMaxSliceNum * sizeof (uint32_t), | |
| 4843 | + "pSliceSeg->pSliceConsumeTime"); | |
| 4844 | + if (NULL == pSliceConsumeTime) { | |
| 4845 | + WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR, | |
| 4846 | + "CWelsH264SVCEncoder::DynSliceRealloc: realloc pSliceConsumeTime not successful"); | |
| 4847 | + return ENC_RETURN_MEMALLOCERR; | |
| 4848 | + } | |
| 4849 | + memcpy (pSliceConsumeTime, pCurLayer->pSliceEncCtx->pSliceConsumeTime, sizeof (int32_t) * iMaxSliceNumOld); | |
| 4850 | + pMA->WelsFree (pCurLayer->pSliceEncCtx->pSliceConsumeTime, "pSliceSeg->pSliceConsumeTime"); | |
| 4851 | + pCurLayer->pSliceEncCtx->pSliceConsumeTime = pSliceConsumeTime; | |
| 4852 | + | |
| 4842 | 4853 | //deal with rate control variables |
| 4843 | 4854 | const int32_t kiCurDid = pCtx->uiDependencyId; |
| 4844 | 4855 | SRCSlicing* pSlcingOverRc = (SRCSlicing*)pMA->WelsMalloc (iMaxSliceNum * sizeof (SRCSlicing), "SlicingOverRC"); |