-
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
Open
karasusan
wants to merge
7
commits into
main
Choose a base branch
from
fix/crash-av1-encoder
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
6683281
add patches
karasusan f6c7cc2
fix
karasusan 9907b8a
Add Vulkan validation layer when debug build.
karasusan 3b95e53
format
karasusan f8084e7
Merge branch 'main' into fix/crash-av1-encoder
karasusan bc97779
Update libwebrtc build scripts
karasusan 68bedc5
format
karasusan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| diff --git a/modules/video_coding/codecs/av1/libaom_av1_encoder.cc b/modules/video_coding/codecs/av1/libaom_av1_encoder.cc | ||
| index 28a8e5f846..817826d248 100644 | ||
| --- a/modules/video_coding/codecs/av1/libaom_av1_encoder.cc | ||
| +++ b/modules/video_coding/codecs/av1/libaom_av1_encoder.cc | ||
| @@ -603,7 +603,9 @@ int32_t LibaomAv1Encoder::Encode( | ||
| // Set frame_for_encode_ data pointers and strides. | ||
| MaybeRewrapImgWithFormat(AOM_IMG_FMT_I420); | ||
| auto i420_buffer = mapped_buffer->GetI420(); | ||
| - RTC_DCHECK(i420_buffer); | ||
| + if (!i420_buffer) { | ||
| + return WEBRTC_VIDEO_CODEC_ENCODER_FAILURE; | ||
| + } | ||
| frame_for_encode_->planes[AOM_PLANE_Y] = | ||
| const_cast<unsigned char*>(i420_buffer->DataY()); | ||
| frame_for_encode_->planes[AOM_PLANE_U] = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| diff --git a/modules/video_coding/codecs/vp9/libvpx_vp9_encoder.cc b/modules/video_coding/codecs/vp9/libvpx_vp9_encoder.cc | ||
| index e460625aea..4194e550df 100644 | ||
| --- a/modules/video_coding/codecs/vp9/libvpx_vp9_encoder.cc | ||
| +++ b/modules/video_coding/codecs/vp9/libvpx_vp9_encoder.cc | ||
| @@ -2090,7 +2090,9 @@ rtc::scoped_refptr<VideoFrameBuffer> LibvpxVp9Encoder::PrepareBufferForProfile0( | ||
| case VideoFrameBuffer::Type::kI420A: { | ||
| MaybeRewrapRawWithFormat(VPX_IMG_FMT_I420); | ||
| const I420BufferInterface* i420_buffer = mapped_buffer->GetI420(); | ||
| - RTC_DCHECK(i420_buffer); | ||
| + if(!i420_buffer) { | ||
| + return {}; | ||
| + } | ||
| raw_->planes[VPX_PLANE_Y] = const_cast<uint8_t*>(i420_buffer->DataY()); | ||
| raw_->planes[VPX_PLANE_U] = const_cast<uint8_t*>(i420_buffer->DataU()); | ||
| raw_->planes[VPX_PLANE_V] = const_cast<uint8_t*>(i420_buffer->DataV()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.