History

Fix issue 3186 (fuzz 18458). Reset held picture reordering list before calling DestroyPicBuff.

It also fix SetUnRef crashing which should only loop for LIST_1 if ref pic is B_SLICE.

xiaotiansf committed 7 years ago

Commit 8b881441 parent fafdd888 files · +163 −147Browse files

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

Unified · Split

codec/decoder/core/src/manage_dec_ref.cpp+11−7
@@ -80,14 +80,17 @@ static void SetUnRef (PPicture pRef) { · 79 unmodified lines
8080 pRef->uiSpatialId = -1;
8181 pRef->iSpsId = -1;
8282 pRef->bIsComplete = false;
83+
84+ if (pRef->eSliceType == I_SLICE) {
85+ return;
86+ }
87+ int32_t lists = pRef->eSliceType == P_SLICE ? 1 : 2;
8388 for (int32_t i = 0; i < MAX_DPB_COUNT; ++i) {
84− if (pRef->pRefPic[LIST_0][i] != NULL) {
85− pRef->pRefPic[LIST_0][i]->bAvailableFlag = true;
86− pRef->pRefPic[LIST_0][i] = NULL;
87− }
88− if (pRef->pRefPic[LIST_1][i] != NULL) {
89− pRef->pRefPic[LIST_1][i]->bAvailableFlag = true;
90− pRef->pRefPic[LIST_1][i] = NULL;
89+ for (int32_t list = 0; list < lists; ++list) {
90+ if (pRef->pRefPic[list][i] != NULL) {
91+ pRef->pRefPic[list][i]->bAvailableFlag = true;
92+ pRef->pRefPic[list][i] = NULL;
93+ }
9194 }
9295 }
9396 }
@@ -189,6 +192,7 @@ static int32_t WelsCheckAndRecoverForFutureDecoding (PWelsDecoderContext pCtx) { · 95 unmodified lines
189192 pRef->iFrameNum = 0;
190193 pRef->iFramePoc = 0;
191194 pRef->uiTemporalId = pRef->uiQualityId = 0;
195+ pRef->eSliceType = pCtx->eSliceType;
192196 ExpandReferencingPicture (pRef->pData, pRef->iWidthInPixel, pRef->iHeightInPixel, pRef->iLinesize,
193197 pCtx->sExpandPicFunc.pfExpandLumaPicture, pCtx->sExpandPicFunc.pfExpandChromaPicture);
194198 AddShortTermToList (&pCtx->sRefPic, pRef);

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