зеркало из https://github.com/mozilla/gecko-dev.git
Bug 803791 - Guard against allocating a zero-capacity direct buffer. r=cpeterson
This commit is contained in:
Родитель
8ee4018a47
Коммит
58056c0bdc
|
@ -112,10 +112,12 @@ final class ThumbnailHelper {
|
|||
}
|
||||
try {
|
||||
mBuffer = DirectBufferAllocator.allocate(capacity);
|
||||
} catch (IllegalArgumentException iae) {
|
||||
Log.w(LOGTAG, iae.toString());
|
||||
} catch (OutOfMemoryError oom) {
|
||||
Log.w(LOGTAG, "Unable to allocate thumbnail buffer of capacity " + capacity);
|
||||
// At this point mBuffer will be pointing to null, so we are in a sane state.
|
||||
}
|
||||
// If we hit an error above, mBuffer will be pointing to null, so we are in a sane state.
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче