From fb4e256d497df573ee5748d0316aece38a1f6919 Mon Sep 17 00:00:00 2001 From: "sergeyu@chromium.org" Date: Thu, 16 Jan 2014 04:45:35 +0000 Subject: [PATCH] Fix crash in MouseCursor::CopyOf() This issue was causing test failures with the latest webrtc roll. R=mallinath@webrtc.org Review URL: https://webrtc-codereview.appspot.com/7249005 git-svn-id: http://webrtc.googlecode.com/svn/trunk@5392 4adac7df-926f-26a2-2b94-8c16560cd09d --- webrtc/modules/desktop_capture/mouse_cursor.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/webrtc/modules/desktop_capture/mouse_cursor.cc b/webrtc/modules/desktop_capture/mouse_cursor.cc index c6c58d87cb..07c89f043a 100644 --- a/webrtc/modules/desktop_capture/mouse_cursor.cc +++ b/webrtc/modules/desktop_capture/mouse_cursor.cc @@ -27,9 +27,10 @@ MouseCursor::~MouseCursor() {} // static MouseCursor* MouseCursor::CopyOf(const MouseCursor& cursor) { - return new MouseCursor( - cursor.image() ? NULL : BasicDesktopFrame::CopyOf(*cursor.image()), - cursor.hotspot()); + return cursor.image() + ? new MouseCursor(BasicDesktopFrame::CopyOf(*cursor.image()), + cursor.hotspot()) + : new MouseCursor(); } } // namespace webrtc