From 33fd7c63e1dd897da367322c4ab4e04ae2658750 Mon Sep 17 00:00:00 2001 From: Lyuma Date: Mon, 27 Jun 2022 19:02:42 -0700 Subject: Prevent out-of-bounds write in array conversion; avoid logspam on empty arrays. --- doc/classes/PackedByteArray.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'doc/classes/PackedByteArray.xml') diff --git a/doc/classes/PackedByteArray.xml b/doc/classes/PackedByteArray.xml index 5d0861bcf3..3af3bb8697 100644 --- a/doc/classes/PackedByteArray.xml +++ b/doc/classes/PackedByteArray.xml @@ -409,7 +409,7 @@ Returns a copy of the data converted to a [PackedFloat32Array], where each block of 4 bytes has been converted to a 32-bit float (C++ [code]float[/code]). - The size of the new array will be [code]byte_array.size() / 4[/code]. + The size of the input array must be a multiple of 4 (size of 32-bit float). The size of the new array will be [code]byte_array.size() / 4[/code]. If the original data can't be converted to 32-bit floats, the resulting data is undefined. @@ -417,7 +417,7 @@ Returns a copy of the data converted to a [PackedFloat64Array], where each block of 8 bytes has been converted to a 64-bit float (C++ [code]double[/code], Godot [float]). - The size of the new array will be [code]byte_array.size() / 8[/code]. + The size of the input array must be a multiple of 8 (size of 64-bit double). The size of the new array will be [code]byte_array.size() / 8[/code]. If the original data can't be converted to 64-bit floats, the resulting data is undefined. @@ -425,15 +425,15 @@ Returns a copy of the data converted to a [PackedInt32Array], where each block of 4 bytes has been converted to a signed 32-bit integer (C++ [code]int32_t[/code]). - The size of the new array will be [code]byte_array.size() / 4[/code]. + The size of the input array must be a multiple of 4 (size of 32-bit integer). The size of the new array will be [code]byte_array.size() / 4[/code]. If the original data can't be converted to signed 32-bit integers, the resulting data is undefined. - Returns a copy of the data converted to a [PackedInt64Array], where each block of 4 bytes has been converted to a signed 64-bit integer (C++ [code]int64_t[/code], Godot [int]). - The size of the new array will be [code]byte_array.size() / 8[/code]. + Returns a copy of the data converted to a [PackedInt64Array], where each block of 8 bytes has been converted to a signed 64-bit integer (C++ [code]int64_t[/code], Godot [int]). + The size of the input array must be a multiple of 8 (size of 64-bit integer). The size of the new array will be [code]byte_array.size() / 8[/code]. If the original data can't be converted to signed 64-bit integers, the resulting data is undefined. -- cgit v1.2.3