From 31fe6c76202c14c3a7f18abbb144a51fba29f163 Mon Sep 17 00:00:00 2001 From: Nikolaj Schlej Date: Sat, 9 Jul 2016 11:26:26 +0200 Subject: [PATCH] Bugfix for UD 0.1.0 - use of destroyed object due, local copy needed --- common/fitparser.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/fitparser.cpp b/common/fitparser.cpp index 21e7ceb..74ab7e3 100644 --- a/common/fitparser.cpp +++ b/common/fitparser.cpp @@ -35,7 +35,8 @@ USTATUS FitParser::parse(const UModelIndex & index, const UModelIndex & lastVtfI model->setFixed(index, true); // Special case of FIT header - const FIT_ENTRY* fitHeader = (const FIT_ENTRY*)(model->body(fitIndex).constData() + fitOffset); + UByteArray fitBody = model->body(fitIndex); + const FIT_ENTRY* fitHeader = (const FIT_ENTRY*)(fitBody.constData() + fitOffset); // Check FIT checksum, if present UINT32 fitSize = (fitHeader->Size & 0xFFFFFF) << 4;