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
1247 if (pDq == NULL)1247 if (pDq == NULL)
1248 return ERR_INFO_OUT_OF_MEMORY;1248 return ERR_INFO_OUT_OF_MEMORY;
1249 1249
1250 pCtx->pDqLayersList[i] = pDq; //to keep consistence with in UninitialDqLayersContext()
1250 memset (pDq, 0, sizeof (SDqLayer));1251 memset (pDq, 0, sizeof (SDqLayer));
1251 1252
1252 pCtx->sMb.pMbType[i] = (int16_t*)pMa->WelsMallocz (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (int16_t),1253 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
1337 1338
1338 memset (pCtx->sMb.pSliceIdc[i], 0xff, (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (int32_t)));1339 memset (pCtx->sMb.pSliceIdc[i], 0xff, (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (int32_t)));
1339 1340
1340 pCtx->pDqLayersList[i] = pDq;
1341 ++ i;1341 ++ i;
1342 } while (i < LAYER_NUM_EXCHANGEABLE);1342 } while (i < LAYER_NUM_EXCHANGEABLE);
1343 1343

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