Skip to content

Commit

Permalink
Merge branch 'bug_fix_2' of github.com:tyan0/openh264 into tyan0-bug_…
Browse files Browse the repository at this point in the history
…fix_2
  • Loading branch information
BenzhengZhang committed Jul 31, 2024
2 parents e0bbb7f + be6ff3e commit 9d41e19
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
7 changes: 3 additions & 4 deletions codec/decoder/core/src/decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -797,14 +797,13 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in
bNalStartBytes = true;
} else if (pSrcNal[2 + iSrcIdx] == 0x03) {
if ((3 + iSrcConsumed < iSrcLength) && pSrcNal[3 + iSrcIdx] > 0x03) {
pCtx->iErrorCode |= dsBitstreamError;
return pCtx->iErrorCode;
/* Just skip */
} else {
ST16 (pDstNal + iDstIdx, 0);
iDstIdx += 2;
iSrcIdx += 3;
iSrcConsumed += 3;
}
iSrcIdx += 3;
iSrcConsumed += 3;
} else { // 0x01
bNalStartBytes = false;

Expand Down
2 changes: 1 addition & 1 deletion codec/decoder/core/src/decoder_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2440,7 +2440,7 @@ int32_t InitRefPicList (PWelsDecoderContext pCtx, const uint8_t kuiNRi, int32_t
} else
iRet = WelsInitRefList (pCtx, iPoc);
if ((pCtx->eSliceType != I_SLICE && pCtx->eSliceType != SI_SLICE)) {
#if 0
#if 1
if (pCtx->pSps->uiProfileIdc != 66 && pCtx->pPps->bEntropyCodingModeFlag)
iRet = WelsReorderRefList2 (pCtx);
else
Expand Down
5 changes: 4 additions & 1 deletion codec/decoder/core/src/manage_dec_ref.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,10 @@ int32_t WelsReorderRefList2 (PWelsDecoderContext pCtx) {
int32_t i = 0;
int32_t j = 0;
int32_t k = 0;
int32_t iMaxRefIdx = pCtx->pSps->iNumRefFrames;
int32_t iMaxRefIdx = pCtx->iPicQueueNumber;
if (iMaxRefIdx > MAX_REF_PIC_COUNT) {
iMaxRefIdx = MAX_REF_PIC_COUNT;
}
const int32_t iCurFrameNum = pSliceHeader->iFrameNum;
const int32_t iMaxPicNum = 1 << pSliceHeader->pSps->uiLog2MaxFrameNum;
int32_t iListCount = 1;
Expand Down

0 comments on commit 9d41e19

Please sign in to comment.