Skip to content

Commit

Permalink
Add workaround for frame decode error due to emulation byte.
Browse files Browse the repository at this point in the history
  • Loading branch information
tyan0 committed Jan 24, 2024
1 parent da9a878 commit be6ff3e
Showing 1 changed file with 3 additions and 4 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

0 comments on commit be6ff3e

Please sign in to comment.