History

fix memory leak when alloc failed in decoder

unknown committed 10 years ago

Commit 693fd141 parent a8d95761 file · +1 −1Browse files

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

Unified · Split

codec/decoder/core/src/decoder_core.cpp+1−1
@@ -1247,6 +1247,7 @@ int32_t InitialDqLayersContext (PWelsDecoderContext pCtx, const int32_t kiMaxWid · 1246 unmodified lines
12471247 if (pDq == NULL)
12481248 return ERR_INFO_OUT_OF_MEMORY;
12491249
1250+ pCtx->pDqLayersList[i] = pDq; //to keep consistence with in UninitialDqLayersContext()
12501251 memset (pDq, 0, sizeof (SDqLayer));
12511252
12521253 pCtx->sMb.pMbType[i] = (int16_t*)pMa->WelsMallocz (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (int16_t),
@@ -1337,7 +1338,6 @@ int32_t InitialDqLayersContext (PWelsDecoderContext pCtx, const int32_t kiMaxWid · 84 unmodified lines
13371338
13381339 memset (pCtx->sMb.pSliceIdc[i], 0xff, (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (int32_t)));
13391340
1340− pCtx->pDqLayersList[i] = pDq;
13411341 ++ i;
13421342 } while (i < LAYER_NUM_EXCHANGEABLE);
13431343

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