Skip to content

Commit

Permalink
Fix segfault caused in WelsDecodeInitAccessUnitStart()
Browse files Browse the repository at this point in the history
... if CWelsDecoder::InitDecoderCtx() is not called.
  • Loading branch information
tyan0 committed Mar 24, 2024
1 parent 305c885 commit 9346920
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions codec/decoder/core/src/decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,7 @@ int32_t WelsOpenDecoder (PWelsDecoderContext pCtx, SLogContext* pLogCtx) {
pCtx->bPrintFrameErrorTraceFlag = true;
pCtx->iIgnoredErrorInfoPacketCount = 0;
pCtx->bFrameFinish = true;
pCtx->iSeqNum = 0;
return iRet;
}

Expand Down
11 changes: 8 additions & 3 deletions codec/decoder/core/src/decoder_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2261,10 +2261,15 @@ int32_t WelsDecodeInitAccessUnitStart (PWelsDecoderContext pCtx, SBufferInfo* pD
pCtx->bAuReadyFlag = false;
pCtx->pLastDecPicInfo->bLastHasMmco5 = false;
bool bTmpNewSeqBegin = CheckNewSeqBeginAndUpdateActiveLayerSps (pCtx);
if (bTmpNewSeqBegin)
(*pCtx->pStreamSeqNum)++;
if (bTmpNewSeqBegin) {
if (pCtx->pStreamSeqNum)
(*pCtx->pStreamSeqNum)++;
else
pCtx->iSeqNum++;
}
pCtx->bNewSeqBegin = pCtx->bNewSeqBegin || bTmpNewSeqBegin;
pCtx->iSeqNum = *pCtx->pStreamSeqNum;
if (pCtx->pStreamSeqNum)
pCtx->iSeqNum = *pCtx->pStreamSeqNum;
iErr = WelsDecodeAccessUnitStart (pCtx);
GetVclNalTemporalId (pCtx);

Expand Down

0 comments on commit 9346920

Please sign in to comment.