summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorPat Tjin <pattjin@google.com>2015-05-07 21:21:13 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-05-07 21:21:13 +0000
commit814e728b33f506ada5223e295d35186d4a90c8e9 (patch)
tree0dfa5fde05b07861b04b5c032ebf854623ed8c86 /services
parente68dad2ab2ee76c864976eac9ced0730d55d3e16 (diff)
parentdeb6baa6b349cc5c176b911bcd1e551d15404bf7 (diff)
downloadframeworks_native-814e728b33f506ada5223e295d35186d4a90c8e9.zip
frameworks_native-814e728b33f506ada5223e295d35186d4a90c8e9.tar.gz
frameworks_native-814e728b33f506ada5223e295d35186d4a90c8e9.tar.bz2
am deb6baa6: Merge "surfaceflinger: Fix range check for getFormat" into mnc-dev
* commit 'deb6baa6b349cc5c176b911bcd1e551d15404bf7': surfaceflinger: Fix range check for getFormat
Diffstat (limited to 'services')
-rw-r--r--services/surfaceflinger/DisplayHardware/HWComposer.cpp2
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;