History

move the assigning m_uiSpatialPicNum earlier to cover the memory leak if error in allocating pic

sijchen committed 10 years ago

Commit 025500d1 parent 36722c51 file · +1 −1Browse files

Showing the changes to codec/encoder/core/src/wels_preprocess.cpp (1 of 1 file). Show all

Unified · Split

codec/encoder/core/src/wels_preprocess.cpp+1−1
@@ -135,6 +135,7 @@ int32_t CWelsPreProcess::AllocSpatialPictures (sWelsEncCtx* pCtx, SWelsSvcCoding · 134 unmodified lines
135135 const uint8_t kuiRefNumInTemporal = kuiLayerInTemporal + pParam->iLTRRefNum;
136136 uint8_t i = 0;
137137
138+ m_uiSpatialPicNum[iDlayerIndex] = kuiRefNumInTemporal;
138139 do {
139140 SPicture* pPic = AllocPicture (pMa, kiPicWidth, kiPicHeight, false, 0);
140141 WELS_VERIFY_RETURN_IF (1, (NULL == pPic))
@@ -147,7 +148,6 @@ int32_t CWelsPreProcess::AllocSpatialPictures (sWelsEncCtx* pCtx, SWelsSvcCoding · 6 unmodified lines
147148 else
148149 m_uiSpatialLayersInTemporal[iDlayerIndex] = kuiLayerInTemporal;
149150
150− m_uiSpatialPicNum[iDlayerIndex] = kuiRefNumInTemporal;
151151 ++ iDlayerIndex;
152152 } while (iDlayerIndex < kiDlayerCount);
153153

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