diff options
| -rw-r--r-- | services/surfaceflinger/Layer.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index 32f300fff9..383c0454ce 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -227,8 +227,13 @@ void Layer::setPerFrameData(hwc_layer_t* hwcl) { } else { hwcl->sourceCrop.left = 0; hwcl->sourceCrop.top = 0; - hwcl->sourceCrop.right = buffer->width; - hwcl->sourceCrop.bottom = buffer->height; + if (buffer != NULL) { + hwcl->sourceCrop.right = buffer->width; + hwcl->sourceCrop.bottom = buffer->height; + } else { + hwcl->sourceCrop.right = mTransformedBounds.width(); + hwcl->sourceCrop.bottom = mTransformedBounds.height(); + } } } |