OpenH264: report error on unsupported pixel format
BUG=webrtc:15713 Change-Id: I32aa14aced59ed8f1a9a3a9b8f70182d704e3354 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/330460 Commit-Queue: Philipp Hancke <phancke@microsoft.com> Reviewed-by: Sergey Silkin <ssilkin@webrtc.org> Reviewed-by: Natalie Silvanovich <natashenka@google.com> Cr-Commit-Position: refs/heads/main@{#41420}
This commit is contained in:
parent
5692649b9b
commit
f698a39eec
@ -80,7 +80,11 @@ int H264DecoderImpl::AVGetBuffer2(AVCodecContext* context,
|
||||
kPixelFormatsSupported.begin(), kPixelFormatsSupported.end(),
|
||||
[context](AVPixelFormat format) { return context->pix_fmt == format; });
|
||||
|
||||
RTC_CHECK(pixelFormatSupported != kPixelFormatsSupported.end());
|
||||
if (pixelFormatSupported == kPixelFormatsSupported.end()) {
|
||||
RTC_LOG(LS_ERROR) << "Unsupported pixel format: " << context->pix_fmt;
|
||||
decoder->ReportError();
|
||||
return -1;
|
||||
}
|
||||
|
||||
// `av_frame->width` and `av_frame->height` are set by FFmpeg. These are the
|
||||
// actual image's dimensions and may be different from `context->width` and
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user