summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/extension/gdextension_interface.cpp4
-rw-r--r--core/extension/gdextension_interface.h4
-rw-r--r--core/io/image.cpp2
-rw-r--r--core/io/marshalls.cpp6
4 files changed, 8 insertions, 8 deletions
diff --git a/core/extension/gdextension_interface.cpp b/core/extension/gdextension_interface.cpp
index d1b4e6a30f..e02e7aa701 100644
--- a/core/extension/gdextension_interface.cpp
+++ b/core/extension/gdextension_interface.cpp
@@ -159,9 +159,7 @@ public:
userdata = p_info->callable_userdata;
token = p_info->token;
- if (p_info->object != nullptr) {
- object = ((Object *)p_info->object)->get_instance_id();
- }
+ object = p_info->object_id;
call_func = p_info->call_func;
is_valid_func = p_info->is_valid_func;
diff --git a/core/extension/gdextension_interface.h b/core/extension/gdextension_interface.h
index 240da6e073..d58f0226d8 100644
--- a/core/extension/gdextension_interface.h
+++ b/core/extension/gdextension_interface.h
@@ -392,7 +392,7 @@ typedef GDExtensionBool (*GDExtensionCallableCustomLessThan)(void *callable_user
typedef void (*GDExtensionCallableCustomToString)(void *callable_userdata, GDExtensionBool *r_is_valid, GDExtensionStringPtr r_out);
typedef struct {
- /* Only `call_func` and `token` are strictly required, however, `object` should be passed if its not a static method.
+ /* Only `call_func` and `token` are strictly required, however, `object_id` should be passed if its not a static method.
*
* `token` should point to an address that uniquely identifies the GDExtension (for example, the
* `GDExtensionClassLibraryPtr` passed to the entry symbol function.
@@ -409,7 +409,7 @@ typedef struct {
void *callable_userdata;
void *token;
- GDExtensionObjectPtr object;
+ GDObjectInstanceID object_id;
GDExtensionCallableCustomCall call_func;
GDExtensionCallableCustomIsValid is_valid_func;
diff --git a/core/io/image.cpp b/core/io/image.cpp
index 15d0182dfc..ce08b417a8 100644
--- a/core/io/image.cpp
+++ b/core/io/image.cpp
@@ -3773,7 +3773,7 @@ void Image::fix_alpha_edges() {
}
int closest_dist = max_dist;
- uint8_t closest_color[3];
+ uint8_t closest_color[3] = { 0 };
int from_x = MAX(0, j - max_radius);
int to_x = MIN(width - 1, j + max_radius);
diff --git a/core/io/marshalls.cpp b/core/io/marshalls.cpp
index 79e4b207d4..3d384d9345 100644
--- a/core/io/marshalls.cpp
+++ b/core/io/marshalls.cpp
@@ -1621,8 +1621,10 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo
encode_uint32(datalen, buf);
buf += 4;
const uint8_t *r = data.ptr();
- memcpy(buf, &r[0], datalen * datasize);
- buf += datalen * datasize;
+ if (r) {
+ memcpy(buf, &r[0], datalen * datasize);
+ buf += datalen * datasize;
+ }
}
r_len += 4 + datalen * datasize;