diff --git a/engine/src/flutter/lib/ui/text/paragraph_builder.cc b/engine/src/flutter/lib/ui/text/paragraph_builder.cc index 5f5fb8c814..b6a2c2463c 100644 --- a/engine/src/flutter/lib/ui/text/paragraph_builder.cc +++ b/engine/src/flutter/lib/ui/text/paragraph_builder.cc @@ -183,8 +183,10 @@ void decodeStrut(Dart_Handle strut_data, static_cast(uint8_data[byte_count++]); } - float float_data[byte_data.length_in_bytes() - byte_count / 4]; - memcpy(float_data, static_cast(byte_data.data()) + byte_count, + std::vector float_data; + float_data.resize((byte_data.length_in_bytes() - byte_count) / 4); + memcpy(float_data.data(), + static_cast(byte_data.data()) + byte_count, byte_data.length_in_bytes() - byte_count); size_t float_count = 0; if (mask & sFontSizeMask) {