am deb6baa6: Merge "surfaceflinger: Fix range check for getFormat" into mnc-dev

* commit 'deb6baa6b349cc5c176b911bcd1e551d15404bf7':
  surfaceflinger: Fix range check for getFormat
This commit is contained in:
Pat Tjin 2015-05-07 21:21:13 +00:00 committed by Android Git Automerger
commit 814e728b33
1 changed files with 1 additions and 1 deletions

View File

@ -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;