Showing the changes to codec/decoder/core/src/decoder.cpp (1 of 1 file). Show all
Unified · Split
| @@ -210,22 +210,12 @@ static int32_t DecreasePicBuff (PWelsDecoderContext pCtx, PPicBuff* ppPicBuf, co · 209 unmodified lines | |||
| 210 | } | 210 | } |
| 211 | 211 | ||
| 212 | //update references due to allocation changes | 212 | //update references due to allocation changes |
| 213 | //all references' references have to be reset oss-buzz 14423 | ||
| 213 | for (int32_t i = 0; i < kiNewSize; i++) { | 214 | for (int32_t i = 0; i < kiNewSize; i++) { |
| 214 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { | 215 | for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) { |
| 215 | int32_t j = -1; | 216 | int32_t j = -1; |
| 216 | while (++j < MAX_DPB_COUNT && pPicNewBuf->ppPic[i]->pRefPic[listIdx][j] != NULL) { | 217 | while (++j < MAX_DPB_COUNT && pPicNewBuf->ppPic[i]->pRefPic[listIdx][j] != NULL) { |
| 217 | unsigned long long uiTimeStamp = pPicNewBuf->ppPic[i]->pRefPic[listIdx][j]->uiTimeStamp; | 218 | pPicNewBuf->ppPic[i]->pRefPic[listIdx][j] = NULL; |
| 218 | bool foundThePic = false; | ||
| 219 | for (int32_t k = 0; k < kiNewSize; k++) { | ||
| 220 | if (pPicNewBuf->ppPic[k]->uiTimeStamp == uiTimeStamp) { | ||
| 221 | pPicNewBuf->ppPic[i]->pRefPic[listIdx][j] = pPicNewBuf->ppPic[k]; | ||
| 222 | foundThePic = true; | ||
| 223 | break; | ||
| 224 | } | ||
| 225 | } | ||
| 226 | if (!foundThePic) { | ||
| 227 | pPicNewBuf->ppPic[i]->pRefPic[listIdx][j] = NULL; | ||
| 228 | } | ||
| 229 | } | 219 | } |
| 230 | } | 220 | } |
| 231 | } | 221 | } |