History

Fix ossz-buzz reported bug 13185 by resetting the references of previously deleted references.

xiaotiansf committed 7 years ago

Commit cbc0adb1 parent 19a94861 file · +15 −0Browse 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+15−0
@@ -213,6 +213,21 @@ static int32_t DecreasePicBuff (PWelsDecoderContext pCtx, PPicBuff* ppPicBuf, co · 212 unmodified lines
213 if (iPrevPicIdx != iPicIdx) {213 if (iPrevPicIdx != iPicIdx) {
214 if (pPicOldBuf->ppPic[iPicIdx] != NULL) {214 if (pPicOldBuf->ppPic[iPicIdx] != NULL) {
215 FreePicture (pPicOldBuf->ppPic[iPicIdx], pMa);215 FreePicture (pPicOldBuf->ppPic[iPicIdx], pMa);
216 //seach and reset the references of deleted references.
217 for (int32_t list = LIST_0; list < LIST_A; ++list) {
218 int32_t refIdx = 0;
219 PPicture pPic = pCtx->sRefPic.pRefList[list][refIdx];
220 while (refIdx < MAX_DPB_COUNT && pPic != NULL) {
221 ++refIdx;
222 int32_t ref = 0;
223 while (ref < MAX_DPB_COUNT && *pPic->pRefPic[ref] != NULL) {
224 if (*pPic->pRefPic[ref] == pPicOldBuf->ppPic[iPicIdx]) {
225 *pPic->pRefPic[ref] = NULL;
226 }
227 ++ref;
228 }
229 }
230 }
216 pPicOldBuf->ppPic[iPicIdx] = NULL;231 pPicOldBuf->ppPic[iPicIdx] = NULL;
217 }232 }
218 }233 }

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