Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 2c610bf

Browse files
authored
Fix dynamic array -> vector (#7645)
1 parent 09a3735 commit 2c610bf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/ui/text/paragraph_builder.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,10 @@ void decodeStrut(Dart_Handle strut_data,
183183
static_cast<txt::FontStyle>(uint8_data[byte_count++]);
184184
}
185185

186-
float float_data[byte_data.length_in_bytes() - byte_count / 4];
187-
memcpy(float_data, static_cast<const char*>(byte_data.data()) + byte_count,
186+
std::vector<float> float_data;
187+
float_data.resize((byte_data.length_in_bytes() - byte_count) / 4);
188+
memcpy(float_data.data(),
189+
static_cast<const char*>(byte_data.data()) + byte_count,
188190
byte_data.length_in_bytes() - byte_count);
189191
size_t float_count = 0;
190192
if (mask & sFontSizeMask) {

0 commit comments

Comments
 (0)