Merge "hwc: NULL check on buffer handle"
diff --git a/libhwcomposer/hwc_utils.cpp b/libhwcomposer/hwc_utils.cpp
index 5018d2e..12a543b 100644
--- a/libhwcomposer/hwc_utils.cpp
+++ b/libhwcomposer/hwc_utils.cpp
@@ -291,13 +291,15 @@
bool isAlphaPresent(hwc_layer_1_t const* layer) {
private_handle_t *hnd = (private_handle_t *)layer->handle;
- int format = hnd->format;
- switch(format) {
+ if(hnd) {
+ int format = hnd->format;
+ switch(format) {
case HAL_PIXEL_FORMAT_RGBA_8888:
case HAL_PIXEL_FORMAT_BGRA_8888:
// In any more formats with Alpha go here..
return true;
default : return false;
+ }
}
return false;
}