Bug 738867 - bufferSubData should return INVALID_VALUE. r=bjacob

This commit is contained in:
Jon Buckley 2013-05-13 09:22:29 -04:00
parent 8f40ac6d80
commit 1bd9937b46

View File

@ -486,10 +486,10 @@ WebGLContext::BufferSubData(GLenum target, WebGLsizeiptr byteOffset,
CheckedUint32 checked_neededByteLength = CheckedUint32(byteOffset) + data->Length();
if (!checked_neededByteLength.isValid())
return ErrorInvalidOperation("bufferSubData: integer overflow computing the needed byte length");
return ErrorInvalidValue("bufferSubData: integer overflow computing the needed byte length");
if (checked_neededByteLength.value() > boundBuffer->ByteLength())
return ErrorInvalidOperation("bufferSubData: not enough data - operation requires %d bytes, but buffer only has %d bytes",
return ErrorInvalidValue("bufferSubData: not enough data - operation requires %d bytes, but buffer only has %d bytes",
checked_neededByteLength.value(), boundBuffer->ByteLength());
MakeContextCurrent();
@ -524,10 +524,10 @@ WebGLContext::BufferSubData(WebGLenum target, WebGLsizeiptr byteOffset,
CheckedUint32 checked_neededByteLength = CheckedUint32(byteOffset) + data.Length();
if (!checked_neededByteLength.isValid())
return ErrorInvalidOperation("bufferSubData: integer overflow computing the needed byte length");
return ErrorInvalidValue("bufferSubData: integer overflow computing the needed byte length");
if (checked_neededByteLength.value() > boundBuffer->ByteLength())
return ErrorInvalidOperation("bufferSubData: not enough data -- operation requires %d bytes, but buffer only has %d bytes",
return ErrorInvalidValue("bufferSubData: not enough data -- operation requires %d bytes, but buffer only has %d bytes",
checked_neededByteLength.value(), boundBuffer->ByteLength());
boundBuffer->ElementArrayCacheBufferSubData(byteOffset, data.Data(), data.Length());