diff options
author | Pat Tjin <pattjin@google.com> | 2015-05-07 20:57:48 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-05-07 20:57:49 +0000 |
commit | deb6baa6b349cc5c176b911bcd1e551d15404bf7 (patch) | |
tree | 6ca1664db72e39f10b9d3fd3bea07cda9977a3ac | |
parent | 5fa32d4b08843d0aeca567a173227e8e37322e8e (diff) | |
parent | 4e3e30c2d5a2a6f7dc4ee8696b1ac2a52dffd5dc (diff) | |
download | frameworks_native-deb6baa6b349cc5c176b911bcd1e551d15404bf7.zip frameworks_native-deb6baa6b349cc5c176b911bcd1e551d15404bf7.tar.gz frameworks_native-deb6baa6b349cc5c176b911bcd1e551d15404bf7.tar.bz2 |
Merge "surfaceflinger: Fix range check for getFormat" into mnc-dev
-rw-r--r-- | services/surfaceflinger/DisplayHardware/HWComposer.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.cpp b/services/surfaceflinger/DisplayHardware/HWComposer.cpp index c8b36ec..579b39e 100644 --- a/services/surfaceflinger/DisplayHardware/HWComposer.cpp +++ b/services/surfaceflinger/DisplayHardware/HWComposer.cpp @@ -461,7 +461,7 @@ sp<Fence> HWComposer::getDisplayFence(int disp) const { } uint32_t HWComposer::getFormat(int disp) const { - if (uint32_t(disp)>31 || !mAllocatedDisplayIDs.hasBit(disp)) { + if (static_cast<uint32_t>(disp) >= MAX_HWC_DISPLAYS || !mAllocatedDisplayIDs.hasBit(disp)) { return HAL_PIXEL_FORMAT_RGBA_8888; } else { return mDisplayData[disp].format; |