Skip to content

Commit

Permalink
Fix off by one regression in decoder
Browse files Browse the repository at this point in the history
Fix iPicBuffIdx bounds check introduced in commit
986bd65 and allow 0 as an index value.

This fixes Big_Buck_Bunny_720_10s_30MB.mp4 playback with gst-play-1.0.
  • Loading branch information
kalev committed Nov 29, 2023
1 parent 34a0d2d commit ff7cc30
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion codec/decoder/plus/src/welsDecoderExt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1136,7 +1136,7 @@ void CWelsDecoder::ReleaseBufferedReadyPictureReorder (PWelsDecoderContext pCtx,
m_sPictInfoList[m_sReoderingStatus.iPictInfoIndex].iPOC = IMinInt32;
int32_t iPicBuffIdx = m_sPictInfoList[m_sReoderingStatus.iPictInfoIndex].iPicBuffIdx;
if (pPicBuff != NULL) {
if (iPicBuffIdx > 0 && iPicBuffIdx < pPicBuff->iCapacity)
if (iPicBuffIdx >= 0 && iPicBuffIdx < pPicBuff->iCapacity)
{
PPicture pPic = pPicBuff->ppPic[iPicBuffIdx];
--pPic->iRefCount;
Expand Down

0 comments on commit ff7cc30

Please sign in to comment.