Skip to content

Commit

Permalink
Fix for out of bounds read issue by introducing bounds check on iPicB…
Browse files Browse the repository at this point in the history
…uffIdx in CWelsDecoder::ReleaseBufferedReadyPictureReorder (#3685)
  • Loading branch information
calvano-fb authored Oct 23, 2023
1 parent 008465e commit 986bd65
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions codec/decoder/plus/src/welsDecoderExt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1132,9 +1132,13 @@ void CWelsDecoder::ReleaseBufferedReadyPictureReorder (PWelsDecoderContext pCtx,
ppDst[1] = pDstInfo->pDst[1];
ppDst[2] = pDstInfo->pDst[2];
m_sPictInfoList[m_sReoderingStatus.iPictInfoIndex].iPOC = IMinInt32;
int32_t iPicBuffIdx = m_sPictInfoList[m_sReoderingStatus.iPictInfoIndex].iPicBuffIdx;
if (pPicBuff != NULL) {
PPicture pPic = pPicBuff->ppPic[m_sPictInfoList[m_sReoderingStatus.iPictInfoIndex].iPicBuffIdx];
--pPic->iRefCount;
if (iPicBuffIdx > 0 && iPicBuffIdx < pPicBuff->iCapacity)
{
PPicture pPic = pPicBuff->ppPic[iPicBuffIdx];
--pPic->iRefCount;
}
}
m_sPictInfoList[m_sReoderingStatus.iPictInfoIndex].bLastGOP = false;
m_sReoderingStatus.iMinPOC = IMinInt32;
Expand Down

2 comments on commit 986bd65

@lekklch
Copy link

@lekklch lekklch commented on 986bd65 Dec 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

position: sticky;
top: 20px;

@lekklch
Copy link

@lekklch lekklch commented on 986bd65 Dec 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.