diff options
author | Brian Salomon <bsalomon@google.com> | 2018-07-12 16:39:23 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-07-16 14:03:36 +0000 |
commit | 6196fc1e540db82fd99042309438b33b0c0e1e0e (patch) | |
tree | b36b1f21ac707efbddf58737b1f6ab5b1ab79aeb /src | |
parent | 1419534a0079618b9c12edd74fd756e36b0523bf (diff) |
In GrContext::readSurfacePixels fail gracefully if temp pixmap allocation
fails.
Bug: chromium:860399
Change-Id: I6793e7fe7e97b7848d40170046dcff4c2fcc48c7
Reviewed-on: https://skia-review.googlesource.com/141101
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/gpu/GrContext.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp index dd4f3218fa..caed7298ae 100644 --- a/src/gpu/GrContext.cpp +++ b/src/gpu/GrContext.cpp @@ -757,7 +757,9 @@ bool GrContextPriv::readSurfacePixels(GrSurfaceContext* src, int left, int top, if (!SkImageInfoValidConversion(finalII, tempII)) { return false; } - tempPixmap.alloc(tempII); + if (!tempPixmap.tryAlloc(tempII)) { + return false; + } finalPixmap.reset(finalII, buffer, rowBytes); buffer = tempPixmap.writable_addr(); rowBytes = tempPixmap.rowBytes(); |