Bug 1220450 - Clear length on cache OOM. r=kamidphish

This commit is contained in:
Jeff Gilbert 2016-01-01 14:00:48 -05:00
parent 220470f0a9
commit 0ea9c8037e

View File

@ -177,7 +177,9 @@ WebGLContext::BufferData(GLenum target, WebGLsizeiptr size, GLenum usage)
}
boundBuffer->SetByteLength(size);
if (!boundBuffer->ElementArrayCacheBufferData(nullptr, size)) {
boundBuffer->SetByteLength(0);
return ErrorOutOfMemory("bufferData: out of memory");
}
}
@ -227,9 +229,12 @@ WebGLContext::BufferDataT(GLenum target,
}
boundBuffer->SetByteLength(data.LengthAllowShared());
// Warning: Possibly shared memory. See bug 1225033.
if (!boundBuffer->ElementArrayCacheBufferData(data.DataAllowShared(), data.LengthAllowShared()))
if (!boundBuffer->ElementArrayCacheBufferData(data.DataAllowShared(), data.LengthAllowShared())) {
boundBuffer->SetByteLength(0);
return ErrorOutOfMemory("bufferData: out of memory");
}
}
void