mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 791905 - reject WebGL canvas sizes greater than INT_MAX - r=jgilbert
This commit is contained in:
parent
eb01982a02
commit
26ad5de498
@ -329,11 +329,18 @@ WebGLContext::SetContextOptions(nsIPropertyBag *aOptions)
|
||||
NS_IMETHODIMP
|
||||
WebGLContext::SetDimensions(int32_t width, int32_t height)
|
||||
{
|
||||
/*** early success return cases ***/
|
||||
// Early error return cases
|
||||
|
||||
if (width < 0 || height < 0) {
|
||||
GenerateWarning("Canvas size is too large (seems like a negative value wrapped)");
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
if (!GetCanvas())
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
// Early success return cases
|
||||
|
||||
GetCanvas()->InvalidateCanvas();
|
||||
|
||||
if (gl && mWidth == width && mHeight == height)
|
||||
@ -362,10 +369,9 @@ WebGLContext::SetDimensions(int32_t width, int32_t height)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/*** End of early success return cases.
|
||||
*** At this point we know that we're not just resizing an existing context,
|
||||
*** we are initializing a new context.
|
||||
***/
|
||||
// End of early return cases.
|
||||
// At this point we know that we're not just resizing an existing context,
|
||||
// we are initializing a new context.
|
||||
|
||||
// if we exceeded either the global or the per-principal limit for WebGL contexts,
|
||||
// lose the oldest-used context now to free resources. Note that we can't do that
|
||||
|
Loading…
Reference in New Issue
Block a user