Skip to content

Commit

Permalink
[LibvpxVp8Encoder] Don't DCHECK crash if I420 is not equal to I420A.
Browse files Browse the repository at this point in the history
In CL https://webrtc-review.googlesource.com/c/src/+/216323 we fixed
the issue where I420 and I420A not being equal would result in dropping
frames in release builds.

But we forgot to update the corresponding DCHECK, meaning the I420 not
being the same as I420A issue still causes crashes on debug builds.
(I must have been running a release build not to catch this before?)

This CL replaces the DCHECK_EQ with an RTC_NOTREACHED inside the
IsCompatibleVideoFrameBufferType check.

Because this only affects debug builds, this CL does not need to be
backmerged anywhere.

Bug: chromium:1203206
Change-Id: I101823e8bca293e94d0f7ce507fe78cedff3ea1b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/219281
Reviewed-by: Ilya Nikolaevskiy <[email protected]>
Commit-Queue: Henrik Boström <[email protected]>
Cr-Commit-Position: refs/heads/master@{#34048}
  • Loading branch information
henbos authored and WebRTC LUCI CQ committed May 19, 2021
1 parent 91a892f commit 38f1d4b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions modules/video_coding/codecs/vp8/libvpx_vp8_encoder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1388,8 +1388,6 @@ LibvpxVp8Encoder::PrepareBuffers(rtc::scoped_refptr<VideoFrameBuffer> buffer) {
}
scaled_buffer = mapped_scaled_buffer;
}
RTC_DCHECK_EQ(scaled_buffer->type(), mapped_buffer->type())
<< "Scaled frames must have the same type as the mapped frame.";
if (!IsCompatibleVideoFrameBufferType(scaled_buffer->type(),
mapped_buffer->type())) {
RTC_LOG(LS_ERROR) << "When scaling "
Expand All @@ -1399,6 +1397,10 @@ LibvpxVp8Encoder::PrepareBuffers(rtc::scoped_refptr<VideoFrameBuffer> buffer) {
<< " instead of "
<< VideoFrameBufferTypeToString(mapped_buffer->type())
<< ". Can't encode frame.";
RTC_NOTREACHED() << "Scaled buffer type "
<< VideoFrameBufferTypeToString(scaled_buffer->type())
<< " is not compatible with mapped buffer type "
<< VideoFrameBufferTypeToString(mapped_buffer->type());
return {};
}
SetRawImagePlanes(&raw_images_[i], scaled_buffer);
Expand Down

0 comments on commit 38f1d4b

Please sign in to comment.