kig / DataStream.js

DataStream.js is a library for reading data from ArrayBuffers
173 stars 39 forks source link

Set minimum buffer length to 1 #5

Closed cintolas closed 10 years ago

cintolas commented 10 years ago

DataStream will crash with a byteOffset out of range error if you run the following code using node js and require.js

install node install requirejs: npm install requirejs Create an example file with the following: example.js

(function(requirejs){ requirejs(['./DataStream'],function(){ var ds = new DataStream(); }); })(require('requirejs'));

Put example.js in the same directory as DataStream.js From the command line run: node example.js

Crash

Fix: Set minimum ArrayBuffer length to 1 when now defined