-
Notifications
You must be signed in to change notification settings - Fork 214
fix: Fix a crash AV1 encoder #1093
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a crash in the AV1 encoder and improves error handling across video codec encoders. The changes focus on preventing null pointer crashes, enhancing debugging capabilities, and ensuring platform compatibility.
Key changes include:
- Added null pointer checks to VP9 and AV1 encoders to prevent crashes when I420 buffer is missing
- Enhanced Vulkan graphics device error logging for better debugging
- Added platform-specific guards for CUDA code to improve portability
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| VulkanGraphicsDevice.cpp | Added error logging for texture access failures and sync timeouts, plus chrono header |
| GpuMemoryBuffer.cpp | Wrapped CUDA-specific code with platform guards |
| libvpx_vp9_encoder.patch | Added null check for I420 buffer to prevent crashes |
| libaom_av1_encoder.patch | Added null check for I420 buffer with proper error code return |
| build_libwebrtc_android.sh | Applied new encoder patches during build process |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| }); | ||
| if (!ret) | ||
| { | ||
| RTC_LOG(LS_ERROR) << "WaitSync timeout. " |
Copilot
AI
Aug 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after 'timeout.' - should be 'timeout. ' to properly separate from the next line.
This pull request introduces several improvements and bug fixes related to video codec encoders and Vulkan graphics device handling. The main focus is on improving error handling in the VP9 and AV1 encoder code, enhancing Vulkan device logging, and ensuring platform-specific code is properly guarded.
Codec Encoder Robustness and Error Handling:
libvpx_vp9_encoder.ccandlibaom_av1_encoder.ccto prevent crashes if the I420 buffer is missing, returning failure codes or empty values as appropriate. [1] [2]build_libwebrtc_android.sh) to apply new patches for VP9 and AV1 encoders, ensuring these error checks are included during the build process.Vulkan Graphics Device Improvements:
VulkanGraphicsDevice.cppfor failed texture access and synchronization timeouts, making debugging easier when Vulkan resource operations fail. [1] [2]<chrono>header inVulkanGraphicsDevice.cppto support time-based operations.Platform-Specific Code Guarding:
GpuMemoryBuffer.cppwith#if CUDA_PLATFORMto ensure it only compiles on supported platforms, improving portability and preventing build errors.