History

additional fix for ossz-buzz bug 13457.

xiaotiansf committed 7 years ago

Commit cfb22041 parent 4227bea1 file · +9 −9Browse files

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

Unified · Split

codec/decoder/core/src/decoder.cpp+9−9
@@ -167,20 +167,20 @@ static int32_t IncreasePicBuff (PWelsDecoderContext pCtx, PPicBuff* ppPicBuf, co · 166 unmodified lines
167167
168168 static void ResetRefPicReferences (const PWelsDecoderContext& pCtx, const PPicture& inPPic) {
169169 //seach and reset the references of deleted references.
170− if (pCtx->eSliceType != B_SLICE) {
171− return;
172− }
173− for (int32_t list = LIST_0; list < LIST_A; ++list) {
170+ int32_t list_count = pCtx->eSliceType == B_SLICE ? 2 : 1;
171+ for (int32_t list = LIST_0; list < list_count; ++list) {
174172 int32_t refIdx = 0;
175173 PPicture pPic = pCtx->sRefPic.pRefList[list][refIdx];
176174 while (refIdx < MAX_DPB_COUNT && pPic != NULL) {
177175 ++refIdx;
178− int32_t ref = 0;
179− while (ref < MAX_DPB_COUNT && *pPic->pRefPic[ref] != NULL) {
180− if (*pPic->pRefPic[ref] == inPPic) {
181− *pPic->pRefPic[ref] = NULL;
176+ for (int32_t i = LIST_0; i < LIST_A; ++i) {
177+ int32_t ref = 0;
178+ while (ref < MAX_DPB_COUNT && pPic->pRefPic[i][ref] != NULL) {
179+ if (pPic->pRefPic[i][ref] == inPPic) {
180+ pPic->pRefPic[i][ref] = NULL;
181+ }
182+ ++ref;
182183 }
183− ++ref;
184184 }
185185 }
186186 }

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