Bug 1391556 - fix incorrect out of bound check. r?jwwang
MozReview-Commit-ID: JytNgl6bqCX
--- a/media/libstagefright/system/core/liblog/fake_log_device.c
+++ b/media/libstagefright/system/core/liblog/fake_log_device.c
@@ -146,17 +146,17 @@ static LogState *openLogTable[MAX_OPEN_L
/*
* Allocate an fd and associate a new LogState with it.
* The fd is available via the fakeFd field of the return value.
*/
static LogState *createLogState()
{
size_t i;
- for (i = 0; i < sizeof(openLogTable); i++) {
+ for (i = 0; i < MAX_OPEN_LOGS; i++) {
if (openLogTable[i] == NULL) {
openLogTable[i] = calloc(1, sizeof(LogState));
openLogTable[i]->fakeFd = FAKE_FD_BASE + i;
return openLogTable[i];
}
}
return NULL;
}