Index: ui/gfx/mac/io_surface.cc |
diff --git a/ui/gfx/mac/io_surface.cc b/ui/gfx/mac/io_surface.cc |
index 4441138e4d8985b7c4bfd4e5ec0ca353f6239745..b10780249f693fcc976f75673616e67bf2cdf7e8 100644 |
--- a/ui/gfx/mac/io_surface.cc |
+++ b/ui/gfx/mac/io_surface.cc |
@@ -164,6 +164,11 @@ IOSurfaceRef CreateIOSurface(const gfx::Size& size, gfx::BufferFormat format) { |
} |
IOSurfaceRef surface = IOSurfaceCreate(properties); |
+ if (!surface) { |
+ LOG(ERROR) << "Failed to allocate IOSurface of size " << size.ToString() |
+ << "."; |
+ return nullptr; |
+ } |
// For unknown reasons, triggering this lock on OS X 10.9, on certain GPUs, |
// causes PDFs to render incorrectly. Hopefully this check can be removed once |