Bug 829420 - [Camera] In GonkNativeWindow::dequeueBuffer, -1 will be used as index to access an Arrary. r=kanru

This commit is contained in:
Marco Chen 2013-01-11 18:18:35 +08:00
parent 835938782f
commit 6e9b4d1ac0

View File

@ -225,8 +225,8 @@ int GonkNativeWindow::dequeueBuffer(android_native_buffer_t** buffer)
* the consumer may still have pending reads of the * the consumer may still have pending reads of the
* buffers in flight. * buffers in flight.
*/ */
bool isOlder = mSlots[i].mFrameNumber < mSlots[found].mFrameNumber; if (found < 0 ||
if (found < 0 || isOlder) { mSlots[i].mFrameNumber < mSlots[found].mFrameNumber) {
found = i; found = i;
} }
} }