ArrayBuffer neutering

Boris Zbarsky bzbarsky at MIT.EDU
Thu May 22 09:28:37 PDT 2014


On 5/22/14, 12:16 PM, Allen Wirfs-Brock wrote:
> Out-of-bounds access have also been observed in non-Emscripten code, for
> example [1] [2].

Out-of-bounds reads are very common in code that works with canvas 
imagedata, because a lot of image-processing algorithms want to examine 
adjacent pixels, and when you get to the end you end up outside the 
array.  Making out-of-bounds access throw on non-neutered 
Uint32ClampedArray is a non-starter, imo.

> It's still early days for production use of TypedArrays

Uh... No, it's not.  They've been shipping for years and people are 
using them all over, as far as I can tell.

> and maybe its not too late to evangelize fixing any major apps that depend upon
> out-of-bounds accesses or accessed to neutered arrays.

Neutering is more recent, so I can't speak to compat issues for neutered 
arrays with certainty.  I can say with certainty that out-of-bounds 
reads on Uint8ClampedArray can't change their behavior.

-Boris


More information about the es-discuss mailing list