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

Fix crash on multi-thread decoding. #3736

Merged
merged 1 commit into from
Apr 10, 2024
Merged

Conversation

tyan0
Copy link
Contributor

@tyan0 tyan0 commented Mar 24, 2024

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.

How to reproduce:

diff --git a/codec/console/dec/src/h264dec.cpp b/codec/console/dec/src/h264dec.cpp
index 59365844..4338bbce 100644
--- a/codec/console/dec/src/h264dec.cpp
+++ b/codec/console/dec/src/h264dec.cpp
@@ -624,7 +624,7 @@ int32_t main (int32_t iArgC, char* pArgV[]) {
     pDecoder->SetOption (DECODER_OPTION_TRACE_LEVEL, &iLevelSetting);
   }

-  int32_t iThreadCount = 0;
+  int32_t iThreadCount = 3;
   pDecoder->SetOption (DECODER_OPTION_NUM_OF_THREADS, &iThreadCount);

   if (pDecoder->Initialize (&sDecParam)) {
  • Build openh264.
  • Run ./h264dec bbb.264 x.yuv
  • This crashes with segfault.

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.
@BenzhengZhang BenzhengZhang merged commit 1debdae into cisco:master Apr 10, 2024
8 checks passed
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

Successfully merging this pull request may close these issues.

None yet

2 participants