History

Fix Issues 13030 and 13039 in oss-fuzz.

xiaotiansf committed 7 years ago

Commit 71d619c1 parent 5ae7dc92 files · +23 −3Browse files

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

Unified · Split

codec/decoder/core/src/decode_slice.cpp+21−2
@@ -56,6 +56,22 @@ extern void FreePicture (PPicture pPic, CMemoryAlign* pMa); · 55 unmodified lines
56 56
57extern PPicture AllocPicture (PWelsDecoderContext pCtx, const int32_t kiPicWidth, const int32_t kiPicHeight);57extern PPicture AllocPicture (PWelsDecoderContext pCtx, const int32_t kiPicWidth, const int32_t kiPicHeight);
58 58
59static bool CheckRefPics (const PWelsDecoderContext& pCtx) {
60 int32_t listCount = 1;
61 if (pCtx->eSliceType == B_SLICE) {
62 ++listCount;
63 }
64 for (int32_t list = LIST_0; list < listCount; ++list) {
65 int32_t refCount = pCtx->sRefPic.uiRefCount[list];
66 for (int32_t refIdx = 0; refIdx < refCount; ++refIdx) {
67 if (!pCtx->sRefPic.pRefList[list][refIdx]) {
68 return false;
69 }
70 }
71 }
72 return true;
73}
74
59int32_t WelsTargetSliceConstruction (PWelsDecoderContext pCtx) {75int32_t WelsTargetSliceConstruction (PWelsDecoderContext pCtx) {
60 PDqLayer pCurLayer = pCtx->pCurDqLayer;76 PDqLayer pCurLayer = pCtx->pCurDqLayer;
61 PSlice pCurSlice = &pCurLayer->sLayerInfo.sSliceInLayer;77 PSlice pCurSlice = &pCurLayer->sLayerInfo.sSliceInLayer;
@@ -318,7 +334,10 @@ int32_t WelsTargetMbConstruction (PWelsDecoderContext pCtx) { · 256 unmodified lines
318 WelsMbIntraPredictionConstruction (pCtx, pCurLayer, 1);334 WelsMbIntraPredictionConstruction (pCtx, pCurLayer, 1);
319 } else if (IS_INTER (pCurLayer->pMbType[pCurLayer->iMbXyIndex])) { //InterMB335 } else if (IS_INTER (pCurLayer->pMbType[pCurLayer->iMbXyIndex])) { //InterMB
320 if (0 == pCurLayer->pCbp[pCurLayer->iMbXyIndex]) { //uiCbp==0 include SKIP336 if (0 == pCurLayer->pCbp[pCurLayer->iMbXyIndex]) { //uiCbp==0 include SKIP
321 WelsMbInterPrediction (pCtx, pCurLayer);337 if (!CheckRefPics (pCtx)) {
338 return ERR_INFO_MB_RECON_FAIL;
339 }
340 return WelsMbInterPrediction (pCtx, pCurLayer);
322 } else {341 } else {
323 WelsMbInterConstruction (pCtx, pCurLayer);342 WelsMbInterConstruction (pCtx, pCurLayer);
324 }343 }
@@ -2783,7 +2802,7 @@ int32_t WelsActualDecodeMbCavlcBSlice (PWelsDecoderContext pCtx) { · 2458 unmodified lines
2783 return ERR_NONE;2802 return ERR_NONE;
2784}2803}
2785 2804
2786void WelsBlockFuncInit (SBlockFunc* pFunc, int32_t iCpu) {2805void WelsBlockFuncInit (SBlockFunc* pFunc, int32_t iCpu) {
2787 pFunc->pWelsSetNonZeroCountFunc = WelsNonZeroCount_c;2806 pFunc->pWelsSetNonZeroCountFunc = WelsNonZeroCount_c;
2788 pFunc->pWelsBlockZero16x16Func = WelsBlockZero16x16_c;2807 pFunc->pWelsBlockZero16x16Func = WelsBlockZero16x16_c;
2789 pFunc->pWelsBlockZero8x8Func = WelsBlockZero8x8_c;2808 pFunc->pWelsBlockZero8x8Func = WelsBlockZero8x8_c;

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