[apps/graph] text_field_function_title_cell: fix read of uninitialized buffer

This fixes the following crash: when reloading the cell before
initializing the m_textFieldBuffer, TextField::ContentView::text() will
use the content of the uninitialized m_textFieldBuffer to compute the
minimalSizeForOptimalDisplay.
This commit is contained in:
Émilie Feral
2020-08-11 14:41:06 +02:00
parent 5b82b94c20
commit ec0e766c94

View File

@@ -8,7 +8,8 @@ namespace Graph {
TextFieldFunctionTitleCell::TextFieldFunctionTitleCell(ListController * listController, Orientation orientation, const KDFont * font) :
Shared::FunctionTitleCell(orientation),
Responder(listController),
m_textField(Shared::Function::k_parenthesedThetaArgumentByteLength, this, m_textFieldBuffer, k_textFieldBufferSize, k_textFieldBufferSize, nullptr, listController, font, 1.0f, 0.5f)
m_textField(Shared::Function::k_parenthesedThetaArgumentByteLength, this, m_textFieldBuffer, k_textFieldBufferSize, k_textFieldBufferSize, nullptr, listController, font, 1.0f, 0.5f),
m_textFieldBuffer("")
{
}