fix wrong conversion on windows from QString to char*

This commit is contained in:
jfmcarreira committed 2014-06-17 17:56:40 +01:00
1 parent aaaeb9da14
commit ff1cfbf9e1
1 file changed
+3 -1
+3 -1
View File
@@ -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 );