fix: PropertyRecorder UB calling &front() on empty buffers (#12607) 623d5fe7a3 Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
diff --git a/.rive_head b/.rive_head index 568d29a..9ef8b10 100644 --- a/.rive_head +++ b/.rive_head
@@ -1 +1 @@ -d779307982703d4c0588e4c957aae64b95b62f32 +623d5fe7a3454f66c88ec19ff0830f7cbb52bc98
diff --git a/src/animation/property_recorder.cpp b/src/animation/property_recorder.cpp index cc84ba8..010d4e0 100644 --- a/src/animation/property_recorder.cpp +++ b/src/animation/property_recorder.cpp
@@ -74,7 +74,7 @@ BinaryDataReader& reader, std::vector<uint8_t>& buffer) { - reader.complete(&buffer.front(), writer.size()); + reader.complete(buffer.data(), writer.size()); } void PropertyRecorder::recordArtboard(const Artboard* artboard) @@ -312,7 +312,7 @@ void PropertyRecorder::apply(StateMachineInstance* stateMachineInstace) { int index = 0; - m_binaryReaderSM.reset(&m_WriteBufferSM.front()); + m_binaryReaderSM.reset(m_WriteBufferSM.data()); while (!m_binaryReaderSM.isEOF() && index < 20) { auto inputType = m_binaryReaderSM.readVarUint32(); @@ -342,7 +342,7 @@ void PropertyRecorder::apply(Artboard* artboard) { - m_binaryReader.reset(&m_WriteBuffer.front()); + m_binaryReader.reset(m_WriteBuffer.data()); while (!m_binaryReader.isEOF()) { auto objectId = m_binaryReader.readVarUint32();