From e488e201531afbc2ec598e5c0c27a9f8b54ad0e0 Mon Sep 17 00:00:00 2001 From: Joshua Granick Date: Wed, 29 Aug 2018 13:23:58 -0700 Subject: [PATCH] Minor pointer fix --- project/src/ExternalInterface.cpp | 3 +++ src/lime/graphics/WebGL2RenderContext.hx | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/project/src/ExternalInterface.cpp b/project/src/ExternalInterface.cpp index 4668e491b..48aa00dce 100644 --- a/project/src/ExternalInterface.cpp +++ b/project/src/ExternalInterface.cpp @@ -452,6 +452,8 @@ namespace lime { double lime_bytes_get_data_pointer_offset (value bytes, int offset) { + if (val_is_null (bytes)) return 0; + Bytes data = Bytes (bytes); return (uintptr_t)data.b + offset; @@ -460,6 +462,7 @@ namespace lime { HL_PRIM double hl_lime_bytes_get_data_pointer_offset (Bytes* bytes, int offset) { + if (!bytes) return 0; return (uintptr_t)bytes->b + offset; } diff --git a/src/lime/graphics/WebGL2RenderContext.hx b/src/lime/graphics/WebGL2RenderContext.hx index e352c9187..97b188c58 100644 --- a/src/lime/graphics/WebGL2RenderContext.hx +++ b/src/lime/graphics/WebGL2RenderContext.hx @@ -2754,7 +2754,7 @@ abstract WebGL2RenderContext(Dynamic) from Dynamic to Dynamic { #if !lime_webgl public inline function texImage2D (target:Int, level:Int, internalformat:Int, width:Int, height:Int, border:Int, format:Int, type:Int, srcData:ArrayBufferView, srcOffset:Int = 0):Void { #else - public inline function texImage2D (foo:Dynamic, target:Int, level:Int, internalformat:Int, width:Int, height:Int, border:Dynamic, ?format:Int, ?type:Int, ?srcData:Dynamic, ?srcOffset:Int):Void { + public inline function texImage2D (target:Int, level:Int, internalformat:Int, width:Int, height:Int, border:Dynamic, ?format:Int, ?type:Int, ?srcData:Dynamic, ?srcOffset:Int):Void { #end #if !lime_webgl