From 311916cb601293f1a8ed9f0574e59b50d8a372fd Mon Sep 17 00:00:00 2001 From: Gary Qian Date: Wed, 30 Jan 2019 13:03:27 -0800 Subject: [PATCH] Fix dynamic array -> vector (flutter/engine#7645) --- engine/src/flutter/lib/ui/text/paragraph_builder.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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) {