am 13c04c27: Merge "surfaceflinger: Fix range check for getFormat"

* commit '13c04c27622c7be474e9368211795bcec052dedb':
  surfaceflinger: Fix range check for getFormat
This commit is contained in:
Dan Stoza 2015-05-28 21:40:27 +00:00 committed by Android Git Automerger
commit 84a507aeea

View File

@ -464,7 +464,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;