fix for [1885684] E/SurfaceFlinger( 60): not enough memory for layer bitmap size=4294938624

This commit is contained in:
Mathias Agopian 2009-07-09 18:16:43 -07:00
parent 7278a129fc
commit 6e2d6483fe
1 changed files with 7 additions and 0 deletions

View File

@ -1236,6 +1236,13 @@ sp<ISurface> SurfaceFlinger::createSurface(ClientID clientId, int pid,
{
LayerBaseClient* layer = 0;
sp<LayerBaseClient::Surface> surfaceHandle;
if (int32_t(w|h) < 0) {
LOGE("createSurface() failed, w or h is negative (w=%d, h=%d)",
int(w), int(h));
return surfaceHandle;
}
Mutex::Autolock _l(mStateLock);
Client* const c = mClientsMap.valueFor(clientId);
if (UNLIKELY(!c)) {