Index: content/renderer/media/webrtc/media_stream_remote_video_source.cc |
diff --git a/content/renderer/media/webrtc/media_stream_remote_video_source.cc b/content/renderer/media/webrtc/media_stream_remote_video_source.cc |
index a151647a7b100221f0f14eb18fbd930fabc43521..a42db405464b450f6e41a6552860d9544c28febb 100644 |
--- a/content/renderer/media/webrtc/media_stream_remote_video_source.cc |
+++ b/content/renderer/media/webrtc/media_stream_remote_video_source.cc |
@@ -88,13 +88,15 @@ void MediaStreamRemoteVideoSource::RemoteVideoSourceDelegate::RenderFrame( |
// the data. |
// TODO(magjed): Update media::VideoFrame to support const data so we don't |
// need to const cast here. |
+ scoped_ptr<cricket::VideoFrame> frame_copy(frame->Copy()); |
video_frame = media::VideoFrame::WrapExternalYuvData( |
media::VideoFrame::YV12, size, gfx::Rect(size), size, |
frame->GetYPitch(), frame->GetUPitch(), frame->GetVPitch(), |
const_cast<uint8_t*>(frame->GetYPlane()), |
const_cast<uint8_t*>(frame->GetUPlane()), |
const_cast<uint8_t*>(frame->GetVPlane()), timestamp, |
- base::Bind(&base::DeletePointer<cricket::VideoFrame>, frame->Copy())); |
+ base::Bind(&base::DeletePointer<cricket::VideoFrame>, |
+ base::Passed(&frame_copy))); |
} |
io_message_loop_->PostTask( |