Showing the changes to codec/decoder/core/src/au_parser.cpp (1 of 1 file). Show all
Unified · Split
| @@ -314,6 +314,11 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade · 313 unmodified lines | ||
| 314 | 314 | iBitSize = (iNalSize << 3) - BsGetTrailingBits (pNal + iNalSize - 1); // convert into bit |
| 315 | 315 | iErr = InitBits (pBs, pNal, iBitSize); |
| 316 | 316 | if (iErr) { |
| 317 | + ForceClearCurrentNal (pCurAu); | |
| 318 | + if (uiAvailNalNum > 1) { | |
| 319 | + pCurAu->uiEndPos = uiAvailNalNum - 2; | |
| 320 | + pCtx->bAuReadyFlag = true; | |
| 321 | + } | |
| 317 | 322 | WelsLog (pLogCtx, WELS_LOG_ERROR, "NAL_UNIT_CODED_SLICE: InitBits() fail due invalid access."); |
| 318 | 323 | pCtx->iErrorCode |= dsBitstreamError; |
| 319 | 324 | return NULL; |