aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/library_gl.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/library_gl.js b/src/library_gl.js
index 8db2c8b6..32457b01 100644
--- a/src/library_gl.js
+++ b/src/library_gl.js
@@ -73,6 +73,8 @@ var LibraryGL = {
glTexImage2D: function(target, level, internalformat, width, height, border, format, type, pixels) {
if (pixels) {
pixels = new Uint8Array(Array_copy(pixels, pixels + width*height*4)); // TODO: optimize
+ } else {
+ pixels = new Uint8Array (width*height*4);
}
Module.ctx.texImage2D(target, level, internalformat, width, height, border, format, type, pixels);
},