From ff1cfbf9e1b6eaa3c462de54880e78fd4509fa31 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Tue, 17 Jun 2014 17:44:00 +0100 Subject: [PATCH] fix wrong conversion on windows from QString to char* --- source/lib/PlaYUVerStream.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/lib/PlaYUVerStream.cpp b/source/lib/PlaYUVerStream.cpp index 216c868..9b098e6 100644 --- a/source/lib/PlaYUVerStream.cpp +++ b/source/lib/PlaYUVerStream.cpp @@ -160,13 +160,15 @@ Bool PlaYUVerStream::open( QString filename, UInt width, UInt height, Int input_ if( !avStatus ) { m_pFile = NULL; - Char *filename = m_cFilename.toLocal8Bit().data(); + Char *filename = new char[m_cFilename.length() + 1]; + memcpy(filename, m_cFilename.toUtf8().constData(), m_cFilename.length() + 1 * sizeof(char)); m_pFile = fopen( filename, "rb" ); if( m_pFile == NULL ) { close(); return m_bInit; } + delete[] filename; fseek( m_pFile, 0, SEEK_END ); m_uiTotalFrameNum = ftell( m_pFile ) / ( frame_bytes_input ); fseek( m_pFile, 0, SEEK_SET );