gralloc-qsd8k: make sure that we never try to allocatio 0 bytes
Change-Id: Ic05b895c09a55d746c737aa0c3356edc511d7c96 Signed-off-by: Dima Zavin <dima@android.com>
This commit is contained in:
parent
8451e38453
commit
7e8932dad3
@ -386,6 +386,9 @@ static int gralloc_alloc(alloc_device_t* dev,
|
||||
size = alignedw * alignedh * bpp;
|
||||
}
|
||||
|
||||
if ((ssize_t)size <= 0)
|
||||
return -EINVAL;
|
||||
|
||||
int err;
|
||||
if (usage & GRALLOC_USAGE_HW_FB) {
|
||||
err = gralloc_alloc_framebuffer(dev, size, usage, pHandle);
|
||||
|
Loading…
x
Reference in New Issue
Block a user