diff options
author | Mathias Agopian <mathias@google.com> | 2011-08-02 18:29:51 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2011-08-02 18:29:57 -0700 |
commit | b17ee7fe4c94523810462858c7417f38f3ba0bcd (patch) | |
tree | 81fa7b419a5beb840f90627102027eb1b75295cf /services | |
parent | 9ebf4ebbb9611f2aafef7d4d22b74015a7b4c8c4 (diff) | |
download | frameworks_base-b17ee7fe4c94523810462858c7417f38f3ba0bcd.zip frameworks_base-b17ee7fe4c94523810462858c7417f38f3ba0bcd.tar.gz frameworks_base-b17ee7fe4c94523810462858c7417f38f3ba0bcd.tar.bz2 |
fix a crasher in surfaceflinger
this would happen if being told to draw before a buffer
was available.
Change-Id: I46d121c73e883078cdbf952063e38b0076f79038
Diffstat (limited to 'services')
-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 32f300f..383c045 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(); + } } } |