From 1debdaecd651007771fc347a11076c9e3115395a Mon Sep 17 00:00:00 2001 From: tyan0 <32232575+tyan0@users.noreply.github.com> Date: Wed, 10 Apr 2024 15:26:37 +0900 Subject: [PATCH] Fix crash on multi-thread decoding. (#3736) When decoding: https://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_1080p_h264.mov in multi-threads, openh264 crashes with segfault. This patch fixes the issue. --- codec/decoder/core/src/decoder.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/codec/decoder/core/src/decoder.cpp b/codec/decoder/core/src/decoder.cpp index f296e9211a..6fd524c14c 100644 --- a/codec/decoder/core/src/decoder.cpp +++ b/codec/decoder/core/src/decoder.cpp @@ -820,8 +820,6 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in if (pCtx->bAuReadyFlag && pCtx->pAccessUnitList->uiAvailUnitsNum != 0) { if (GetThreadCount (pCtx) <= 1) { ConstructAccessUnit (pCtx, ppDst, pDstBufInfo); - } else { - pCtx->pAccessUnitList->uiAvailUnitsNum = 1; } } } @@ -884,8 +882,6 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in if (pCtx->bAuReadyFlag && pCtx->pAccessUnitList->uiAvailUnitsNum != 0) { if (GetThreadCount (pCtx) <= 1) { ConstructAccessUnit (pCtx, ppDst, pDstBufInfo); - } else { - pCtx->pAccessUnitList->uiAvailUnitsNum = 1; } } }