Merge pull request #37504 from qarmin/out_of_bound_cursor
Fix array out of bounds access caused by uninitialised variables
This commit is contained in:
commit
5f11e15571
@ -261,6 +261,7 @@ HashMap<StringName, StringName> ClassDB::compat_classes;
|
|||||||
ClassDB::ClassInfo::ClassInfo() {
|
ClassDB::ClassInfo::ClassInfo() {
|
||||||
|
|
||||||
api = API_NONE;
|
api = API_NONE;
|
||||||
|
class_ptr = nullptr;
|
||||||
creation_func = NULL;
|
creation_func = NULL;
|
||||||
inherits_ptr = NULL;
|
inherits_ptr = NULL;
|
||||||
disabled = false;
|
disabled = false;
|
||||||
|
@ -2215,6 +2215,8 @@ Expression::Expression() :
|
|||||||
root(NULL),
|
root(NULL),
|
||||||
nodes(NULL),
|
nodes(NULL),
|
||||||
execution_error(false) {
|
execution_error(false) {
|
||||||
|
str_ofs = 0;
|
||||||
|
expression_dirty = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Expression::~Expression() {
|
Expression::~Expression() {
|
||||||
|
@ -43,6 +43,7 @@ btRayShape::btRayShape(btScalar length) :
|
|||||||
m_shapeAxis(0, 0, 1) {
|
m_shapeAxis(0, 0, 1) {
|
||||||
m_shapeType = CUSTOM_CONVEX_SHAPE_TYPE;
|
m_shapeType = CUSTOM_CONVEX_SHAPE_TYPE;
|
||||||
setLength(length);
|
setLength(length);
|
||||||
|
slipsOnSlope = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
btRayShape::~btRayShape() {
|
btRayShape::~btRayShape() {
|
||||||
|
@ -43,6 +43,12 @@
|
|||||||
Generic6DOFJointBullet::Generic6DOFJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Transform &frameInA, const Transform &frameInB) :
|
Generic6DOFJointBullet::Generic6DOFJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Transform &frameInA, const Transform &frameInB) :
|
||||||
JointBullet() {
|
JointBullet() {
|
||||||
|
|
||||||
|
for (int i = 0; i < 3; i++) {
|
||||||
|
for (int j = 0; j < PhysicsServer3D::G6DOF_JOINT_FLAG_MAX; j++) {
|
||||||
|
flags[i][j] = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Transform scaled_AFrame(frameInA.scaled(rbA->get_body_scale()));
|
Transform scaled_AFrame(frameInA.scaled(rbA->get_body_scale()));
|
||||||
|
|
||||||
scaled_AFrame.basis.rotref_posscale_decomposition(scaled_AFrame.basis);
|
scaled_AFrame.basis.rotref_posscale_decomposition(scaled_AFrame.basis);
|
||||||
|
@ -194,7 +194,7 @@ public:
|
|||||||
virtual void set_audio_track(int p_track);
|
virtual void set_audio_track(int p_track);
|
||||||
virtual Ref<VideoStreamPlayback> instance_playback();
|
virtual Ref<VideoStreamPlayback> instance_playback();
|
||||||
|
|
||||||
VideoStreamGDNative() {}
|
VideoStreamGDNative() { audio_track = 0; }
|
||||||
};
|
};
|
||||||
|
|
||||||
class ResourceFormatLoaderVideoStreamGDNative : public ResourceFormatLoader {
|
class ResourceFormatLoaderVideoStreamGDNative : public ResourceFormatLoader {
|
||||||
|
@ -371,6 +371,7 @@ WebRTCMultiplayer::WebRTCMultiplayer() {
|
|||||||
unique_id = 0;
|
unique_id = 0;
|
||||||
next_packet_peer = 0;
|
next_packet_peer = 0;
|
||||||
target_peer = 0;
|
target_peer = 0;
|
||||||
|
client_count = 0;
|
||||||
transfer_mode = TRANSFER_MODE_RELIABLE;
|
transfer_mode = TRANSFER_MODE_RELIABLE;
|
||||||
refuse_connections = false;
|
refuse_connections = false;
|
||||||
connection_status = CONNECTION_DISCONNECTED;
|
connection_status = CONNECTION_DISCONNECTED;
|
||||||
|
@ -3374,6 +3374,15 @@ DisplayServerX11::DisplayServerX11(const String &p_rendering_driver, WindowMode
|
|||||||
|
|
||||||
r_error = OK;
|
r_error = OK;
|
||||||
|
|
||||||
|
current_cursor = CURSOR_ARROW;
|
||||||
|
mouse_mode = MOUSE_MODE_VISIBLE;
|
||||||
|
|
||||||
|
for (int i = 0; i < CURSOR_MAX; i++) {
|
||||||
|
|
||||||
|
cursors[i] = None;
|
||||||
|
img[i] = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
last_button_state = 0;
|
last_button_state = 0;
|
||||||
|
|
||||||
xmbstring = NULL;
|
xmbstring = NULL;
|
||||||
@ -3650,14 +3659,6 @@ DisplayServerX11::DisplayServerX11(const String &p_rendering_driver, WindowMode
|
|||||||
cursor_theme = "default";
|
cursor_theme = "default";
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < CURSOR_MAX; i++) {
|
|
||||||
|
|
||||||
cursors[i] = None;
|
|
||||||
img[i] = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
current_cursor = CURSOR_ARROW;
|
|
||||||
|
|
||||||
for (int i = 0; i < CURSOR_MAX; i++) {
|
for (int i = 0; i < CURSOR_MAX; i++) {
|
||||||
|
|
||||||
static const char *cursor_file[] = {
|
static const char *cursor_file[] = {
|
||||||
|
@ -293,6 +293,7 @@ GIProbeData::GIProbeData() {
|
|||||||
propagation = 0.7;
|
propagation = 0.7;
|
||||||
anisotropy_strength = 0.5;
|
anisotropy_strength = 0.5;
|
||||||
interior = false;
|
interior = false;
|
||||||
|
use_two_bounces = false;
|
||||||
|
|
||||||
probe = RS::get_singleton()->gi_probe_create();
|
probe = RS::get_singleton()->gi_probe_create();
|
||||||
}
|
}
|
||||||
|
@ -516,6 +516,11 @@ AnimationNodeStateMachinePlayback::AnimationNodeStateMachinePlayback() {
|
|||||||
len_current = 0;
|
len_current = 0;
|
||||||
fading_time = 0;
|
fading_time = 0;
|
||||||
stop_request = false;
|
stop_request = false;
|
||||||
|
len_total = 0.0;
|
||||||
|
pos_current = 0.0;
|
||||||
|
loops_current = 0;
|
||||||
|
fading_pos = 0.0;
|
||||||
|
start_request_travel = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////
|
||||||
|
@ -1514,6 +1514,7 @@ PopupMenu::PopupMenu() {
|
|||||||
submenu_over = -1;
|
submenu_over = -1;
|
||||||
initial_button_mask = 0;
|
initial_button_mask = 0;
|
||||||
during_grabbed_click = false;
|
during_grabbed_click = false;
|
||||||
|
invalidated_click = false;
|
||||||
|
|
||||||
allow_search = false;
|
allow_search = false;
|
||||||
search_time_msec = 0;
|
search_time_msec = 0;
|
||||||
|
@ -122,6 +122,8 @@ private:
|
|||||||
parent = NULL;
|
parent = NULL;
|
||||||
E = NULL;
|
E = NULL;
|
||||||
line = 0;
|
line = 0;
|
||||||
|
index = 0;
|
||||||
|
type = ITEM_FRAME;
|
||||||
}
|
}
|
||||||
virtual ~Item() { _clear_children(); }
|
virtual ~Item() { _clear_children(); }
|
||||||
};
|
};
|
||||||
|
@ -84,7 +84,10 @@ private:
|
|||||||
|
|
||||||
float transition;
|
float transition;
|
||||||
float time; // time in secs
|
float time; // time in secs
|
||||||
Key() { transition = 1; }
|
Key() {
|
||||||
|
transition = 1;
|
||||||
|
time = 0;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// transform key holds either Vector3 or Quaternion
|
// transform key holds either Vector3 or Quaternion
|
||||||
|
@ -997,6 +997,7 @@ SelfList<DynamicFont>::List *DynamicFont::dynamic_fonts = NULL;
|
|||||||
DynamicFont::DynamicFont() :
|
DynamicFont::DynamicFont() :
|
||||||
font_list(this) {
|
font_list(this) {
|
||||||
|
|
||||||
|
valid = false;
|
||||||
cache_id.size = 16;
|
cache_id.size = 16;
|
||||||
outline_cache_id.size = 16;
|
outline_cache_id.size = 16;
|
||||||
spacing_top = 0;
|
spacing_top = 0;
|
||||||
|
@ -363,4 +363,7 @@ AudioEffectPitchShift::AudioEffectPitchShift() {
|
|||||||
pitch_scale = 1.0;
|
pitch_scale = 1.0;
|
||||||
oversampling = 4;
|
oversampling = 4;
|
||||||
fft_size = FFT_SIZE_2048;
|
fft_size = FFT_SIZE_2048;
|
||||||
|
wet = 0.0;
|
||||||
|
dry = 0.0;
|
||||||
|
filter = false;
|
||||||
}
|
}
|
||||||
|
@ -571,7 +571,7 @@ private:
|
|||||||
Rect2 atlas_rect;
|
Rect2 atlas_rect;
|
||||||
};
|
};
|
||||||
|
|
||||||
RS::LightType light_type;
|
RS::LightType light_type = RS::LIGHT_DIRECTIONAL;
|
||||||
|
|
||||||
ShadowTransform shadow_transform[4];
|
ShadowTransform shadow_transform[4];
|
||||||
|
|
||||||
@ -581,7 +581,7 @@ private:
|
|||||||
|
|
||||||
Vector3 light_vector;
|
Vector3 light_vector;
|
||||||
Vector3 spot_vector;
|
Vector3 spot_vector;
|
||||||
float linear_att;
|
float linear_att = 0.0;
|
||||||
|
|
||||||
uint64_t shadow_pass = 0;
|
uint64_t shadow_pass = 0;
|
||||||
uint64_t last_scene_pass = 0;
|
uint64_t last_scene_pass = 0;
|
||||||
@ -590,7 +590,7 @@ private:
|
|||||||
uint32_t light_index = 0;
|
uint32_t light_index = 0;
|
||||||
uint32_t light_directional_index = 0;
|
uint32_t light_directional_index = 0;
|
||||||
|
|
||||||
uint32_t current_shadow_atlas_key;
|
uint32_t current_shadow_atlas_key = 0;
|
||||||
|
|
||||||
Vector2 dp;
|
Vector2 dp;
|
||||||
|
|
||||||
|
@ -218,7 +218,7 @@ private:
|
|||||||
struct Mesh {
|
struct Mesh {
|
||||||
|
|
||||||
struct Surface {
|
struct Surface {
|
||||||
RS::PrimitiveType primitive;
|
RS::PrimitiveType primitive = RS::PRIMITIVE_POINTS;
|
||||||
uint32_t format = 0;
|
uint32_t format = 0;
|
||||||
|
|
||||||
RID vertex_buffer;
|
RID vertex_buffer;
|
||||||
@ -232,8 +232,8 @@ private:
|
|||||||
// cache-efficient structure.
|
// cache-efficient structure.
|
||||||
|
|
||||||
struct Version {
|
struct Version {
|
||||||
uint32_t input_mask;
|
uint32_t input_mask = 0;
|
||||||
RD::VertexFormatID vertex_format;
|
RD::VertexFormatID vertex_format = 0;
|
||||||
RID vertex_array;
|
RID vertex_array;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -246,7 +246,7 @@ private:
|
|||||||
uint32_t index_count = 0;
|
uint32_t index_count = 0;
|
||||||
|
|
||||||
struct LOD {
|
struct LOD {
|
||||||
float edge_length;
|
float edge_length = 0.0;
|
||||||
RID index_buffer;
|
RID index_buffer;
|
||||||
RID index_array;
|
RID index_array;
|
||||||
};
|
};
|
||||||
@ -456,9 +456,9 @@ private:
|
|||||||
RID color;
|
RID color;
|
||||||
|
|
||||||
//used for retrieving from CPU
|
//used for retrieving from CPU
|
||||||
RD::DataFormat color_format;
|
RD::DataFormat color_format = RD::DATA_FORMAT_R4G4_UNORM_PACK8;
|
||||||
RD::DataFormat color_format_srgb;
|
RD::DataFormat color_format_srgb = RD::DATA_FORMAT_R4G4_UNORM_PACK8;
|
||||||
Image::Format image_format;
|
Image::Format image_format = Image::FORMAT_L8;
|
||||||
|
|
||||||
bool flags[RENDER_TARGET_FLAG_MAX];
|
bool flags[RENDER_TARGET_FLAG_MAX];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user