History

fix order of null pointer protection

huili2 committed 11 years ago

Commit bd8ad201 parent a384df33 files · +5 −5Browse files

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

Unified · Split

codec/decoder/core/src/decoder_core.cpp+2−2
@@ -1265,8 +1265,6 @@ int32_t InitialDqLayersContext (PWelsDecoderContext pCtx, const int32_t kiMaxWid · 1264 unmodified lines
12651265 int8_t) * MB_PARTITION_SIZE, "pCtx->sMb.pSubMbType[]");
12661266 pCtx->sMb.pSliceIdc[i] = (int32_t*) WelsMallocz (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (int32_t),
12671267 "pCtx->sMb.pSliceIdc[]"); // using int32_t for slice_idc, 4/21/2010
1268− if (pCtx->sMb.pSliceIdc[i] != NULL)
1269− memset (pCtx->sMb.pSliceIdc[i], 0xff, (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (int32_t)));
12701268 pCtx->sMb.pResidualPredFlag[i] = (int8_t*) WelsMallocz (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (int8_t),
12711269 "pCtx->sMb.pResidualPredFlag[]");
12721270 //pCtx->sMb.pMotionPredFlag[i] = (uint8_t *) WelsMallocz(pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof(uint8_t), "pCtx->sMb.pMotionPredFlag[]");
@@ -1303,6 +1301,8 @@ int32_t InitialDqLayersContext (PWelsDecoderContext pCtx, const int32_t kiMaxWid · 30 unmodified lines
13031301 )
13041302 )
13051303
1304+ memset (pCtx->sMb.pSliceIdc[i], 0xff, (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (int32_t)));
1305+
13061306 pCtx->pDqLayersList[i] = pDq;
13071307 ++ i;
13081308 } while (i < LAYER_NUM_EXCHANGEABLE);

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