Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Another frame decode error. #3713

Open
tyan0 opened this issue Dec 10, 2023 · 1 comment
Open

Another frame decode error. #3713

tyan0 opened this issue Dec 10, 2023 · 1 comment

Comments

@tyan0
Copy link
Contributor

tyan0 commented Dec 10, 2023

Openh264 fails to decode mp4 file:
https://tyan0.yr32.net/openh264/decode_frame_error2.mp4
with error.

I am not sure this is the right thing, however, the following patch solves the issue.

diff --git a/codec/decoder/core/src/decoder.cpp b/codec/decoder/core/src/decoder.cpp
index dba6711b..9270b61a 100644
--- a/codec/decoder/core/src/decoder.cpp
+++ b/codec/decoder/core/src/decoder.cpp
@@ -796,14 +796,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;
 

Could maintainer please have a look?

@tyan0
Copy link
Contributor Author

tyan0 commented Dec 10, 2023

This errror handling was added by the commit e90068c mearged from PR #2070.
What situation is this necessary? And does the above code change break this fix?

This was referenced Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant