diff --git a/project/src/graphics/opengl/OpenGLBindings.cpp b/project/src/graphics/opengl/OpenGLBindings.cpp index 546919ebe..2cbf71468 100644 --- a/project/src/graphics/opengl/OpenGLBindings.cpp +++ b/project/src/graphics/opengl/OpenGLBindings.cpp @@ -124,6 +124,8 @@ namespace lime { int len = val_int (inLen); int start = val_int (inStart); + if (len == 0) return alloc_null (); + ByteArray bytes (inByteBuffer); const unsigned char *data = bytes.Bytes (); int size = bytes.Size (); @@ -145,6 +147,8 @@ namespace lime { int len = val_int (inLen); int start = val_int (inStart); + if (len == 0) return alloc_null (); + ByteArray bytes (inByteBuffer); const unsigned char *data = bytes.Bytes ();