Bug 1145389 - Add gralloc allocation requet size check r=nical

This commit is contained in:
Sotaro Ikeda 2015-03-25 18:05:11 -07:00
parent b47f624ddc
commit dfcae94801

View File

@ -213,7 +213,12 @@ bool SharedBufferManagerParent::RecvAllocateGrallocBuffer(const IntSize& aSize,
if (aFormat == 0 || aUsage == 0) {
printf_stderr("SharedBufferManagerParent::RecvAllocateGrallocBuffer -- format and usage must be non-zero");
return true;
return false;
}
if (aSize.width <= 0 || aSize.height <= 0) {
printf_stderr("SharedBufferManagerParent::RecvAllocateGrallocBuffer -- requested gralloc buffer size is invalid");
return false;
}
// If the requested size is too big (i.e. exceeds the commonly used max GL texture size)