From b5096bb6409db3cd30f85e7fcefef3d2506febcc Mon Sep 17 00:00:00 2001
From: Karsten Suehring <karsten.suehring@hhi.fraunhofer.de>
Date: Wed, 30 Oct 2024 14:56:49 +0100
Subject: [PATCH] Workaround for VLCReader::xReadString for Visual C++

The current code misses the first character of the string for some reason. Maybe a compiler problem.
Using a local variable fixed this.
---
 source/Lib/DecoderLib/VLCReader.cpp | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/source/Lib/DecoderLib/VLCReader.cpp b/source/Lib/DecoderLib/VLCReader.cpp
index 91235415dc..3356ceacb1 100644
--- a/source/Lib/DecoderLib/VLCReader.cpp
+++ b/source/Lib/DecoderLib/VLCReader.cpp
@@ -185,13 +185,13 @@ void VLCReader::xReadFlag( uint32_t& value, const char* )
 }
 
 #if ENABLE_TRACING || RExt__DECODER_DEBUG_BIT_STATISTICS
-void VLCReader::xReadString( std::string& value, const char *symbolName )
+void VLCReader::xReadString( std::string& valueOut, const char *symbolName )
 #else
-void VLCReader::xReadString( std::string& value, const char*  )
+void VLCReader::xReadString( std::string& valueOut, const char*  )
 #endif
 {
   uint32_t code;
-  value = "";
+  std::string value( "" );;
   do
   {
     m_pcBitstream->read(8, code);
@@ -204,6 +204,7 @@ void VLCReader::xReadString( std::string& value, const char*  )
 #if ENABLE_TRACING
   DTRACE(g_trace_ctx, D_HEADER, "%-50s u(1)  : %s\n", symbolName, value.c_str());
 #endif
+  valueOut = value;
 }
 
 #if RExt__DECODER_DEBUG_BIT_STATISTICS || ENABLE_TRACING
-- 
GitLab