History

Additional fix for oss-fuzz 14267. moving up the removing reference's references

xiaotiansf committed 7 years ago

Commit 6aaa51d1 parent 45056411 file · +11 −8Browse 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+11−8
@@ -209,6 +209,17 @@ static int32_t DecreasePicBuff (PWelsDecoderContext pCtx, PPicBuff* ppPicBuf, co · 208 unmodified lines
209209 iDelIdx = kiNewSize;
210210 }
211211
212+ //remove references
213+ for (int32_t i = 0; i < kiNewSize; i++) {
214+ for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) {
215+ uint32_t j = 0;
216+ while (j < MAX_DPB_COUNT && pPicNewBuf->ppPic[i]->pRefPic[listIdx][j]) {
217+ pPicNewBuf->ppPic[i]->pRefPic[listIdx][j] = 0;
218+ ++j;
219+ }
220+ }
221+ }
222+
212223 for (iPicIdx = iDelIdx; iPicIdx < kiOldSize; iPicIdx++) {
213224 if (iPrevPicIdx != iPicIdx) {
214225 if (pPicOldBuf->ppPic[iPicIdx] != NULL) {
@@ -228,14 +239,6 @@ static int32_t DecreasePicBuff (PWelsDecoderContext pCtx, PPicBuff* ppPicBuf, co · 13 unmodified lines
228239 pPicNewBuf->ppPic[i]->uiRefCount = 0;
229240 pPicNewBuf->ppPic[i]->bAvailableFlag = true;
230241 pPicNewBuf->ppPic[i]->bIsComplete = false;
231− //remove references
232− for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) {
233− uint32_t i = 0;
234− while (i < MAX_DPB_COUNT && pPicNewBuf->ppPic[i]->pRefPic[listIdx][i]) {
235− pPicNewBuf->ppPic[i]->pRefPic[listIdx][i] = 0;
236− ++i;
237− }
238− }
239242 }
240243 // remove old PicBuf
241244 if (pPicOldBuf->ppPic != NULL) {

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