Index: content/renderer/media/rtc_video_decoder.cc |
diff --git a/content/renderer/media/rtc_video_decoder.cc b/content/renderer/media/rtc_video_decoder.cc |
index aebe9f2846c8e5e72cd12c73af4ccacfe66cf01d..664e730fb457480246fb31f7886007cc5ddd4173 100644 |
--- a/content/renderer/media/rtc_video_decoder.cc |
+++ b/content/renderer/media/rtc_video_decoder.cc |
@@ -370,6 +370,11 @@ void RTCVideoDecoder::PictureReady(const media::Picture& picture) { |
scoped_refptr<media::VideoFrame> frame = |
CreateVideoFrame(picture, pb, timestamp, visible_rect); |
+ if (!frame) { |
+ LOG(ERROR) << "Couldn't create video frame"; |
+ NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); |
+ return; |
+ } |
bool inserted = |
picture_buffers_at_display_.insert(std::make_pair( |
picture.picture_buffer_id(), |
@@ -405,15 +410,15 @@ scoped_refptr<media::VideoFrame> RTCVideoDecoder::CreateVideoFrame( |
// as ARGB. This prevents the compositor from messing with it, since the |
// underlying platform can handle the former format natively. Make sure the |
// correct format is used and everyone down the line understands it. |
- scoped_refptr<media::VideoFrame> frame(media::VideoFrame::WrapNativeTexture( |
+ scoped_refptr<media::VideoFrame> frame = media::VideoFrame::WrapNativeTexture( |
media::PIXEL_FORMAT_ARGB, |
gpu::MailboxHolder(pb.texture_mailbox(), gpu::SyncToken(), |
decoder_texture_target_), |
media::BindToCurrentLoop(base::Bind( |
&RTCVideoDecoder::ReleaseMailbox, weak_factory_.GetWeakPtr(), |
factories_, picture.picture_buffer_id(), pb.texture_id())), |
- pb.size(), visible_rect, visible_rect.size(), timestamp_ms)); |
- if (picture.allow_overlay()) { |
+ pb.size(), visible_rect, visible_rect.size(), timestamp_ms); |
+ if (frame && picture.allow_overlay()) { |
Pawel Osciak
2015/11/26 01:19:03
Could we perhaps have an error path here logging t
emircan
2015/12/04 04:20:09
Done. It returns a nullptr and l.374 logs it as we
|
frame->metadata()->SetBoolean(media::VideoFrameMetadata::ALLOW_OVERLAY, |
true); |
} |