From 08ef3e2ea30a0f41b53ad90afc3f5ec5c5585699 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Thu, 29 Feb 2024 12:49:05 -0500 Subject: [PATCH] Match MxStillPresenter::ParseExtra --- LEGO1/omni/src/video/mxstillpresenter.cpp | 36 +++++++++++------------ 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/LEGO1/omni/src/video/mxstillpresenter.cpp b/LEGO1/omni/src/video/mxstillpresenter.cpp index 049ad48c..560e62e6 100644 --- a/LEGO1/omni/src/video/mxstillpresenter.cpp +++ b/LEGO1/omni/src/video/mxstillpresenter.cpp @@ -198,29 +198,27 @@ void MxStillPresenter::ParseExtra() SetBit3(TRUE); } - MxU32 len = m_action->GetExtraLength(); + MxU16 extraLength; + char* extraData; + m_action->GetExtra(extraLength, extraData); - if (len == 0) { - return; - } + if (extraLength & MAXWORD) { + char extraCopy[512]; + memcpy(extraCopy, extraData, extraLength & MAXWORD); + extraCopy[extraLength & MAXWORD] = '\0'; - len &= MAXWORD; - - char buf[512]; - memcpy(buf, m_action->GetExtraData(), len); - buf[len] = '\0'; - - char output[512]; - if (KeyValueStringParse(output, g_strVISIBILITY, buf)) { - if (strcmpi(output, "FALSE") == 0) { - Enable(FALSE); + char output[512]; + if (KeyValueStringParse(output, g_strVISIBILITY, extraCopy)) { + if (strcmpi(output, "FALSE") == 0) { + Enable(FALSE); + } } - } - if (KeyValueStringParse(output, g_strBmpIsmap, buf)) { - SetBit4(TRUE); - SetBit1(FALSE); - SetBit2(FALSE); + if (KeyValueStringParse(output, g_strBmpIsmap, extraCopy)) { + SetBit4(TRUE); + SetBit1(FALSE); + SetBit2(FALSE); + } } }