diff --git a/app/VideoSubWindow.cpp b/app/VideoSubWindow.cpp index 25229b9..bdf6eee 100644 --- a/app/VideoSubWindow.cpp +++ b/app/VideoSubWindow.cpp @@ -507,15 +507,12 @@ Bool VideoSubWindow::guessFormat( QString filename, UInt& rWidth, UInt& rHeight, // Guess resolution by file size if( rWidth == 0 && rHeight == 0 ) { - Char *filename_char = new char[filename.length() + 1]; - memcpy( filename_char, filename.toUtf8().constData(), filename.length() + 1 * sizeof(char) ); - FILE* pF = fopen( filename_char, "rb" ); + FILE* pF = fopen( filename.toStdString().c_str(), "rb" ); if( pF ) { fseek( pF, 0, SEEK_END ); UInt64 uiFileSize = ftell( pF ); fclose( pF ); - delete[] filename_char; Int count = 0, module, frame_bytes, match; for( UInt i = 0; i < stdResList.size(); i++ ) diff --git a/lib/PlaYUVerStream.cpp b/lib/PlaYUVerStream.cpp index c9d6569..7b71812 100644 --- a/lib/PlaYUVerStream.cpp +++ b/lib/PlaYUVerStream.cpp @@ -164,8 +164,8 @@ String PlaYUVerStream::getCodecName() Bool PlaYUVerStream::open( String filename, String resolution, String input_format_name, UInt bitsPel, Int endianness, UInt frame_rate, Bool bInput ) { - UInt width; - UInt height; + UInt width = 0; + UInt height = 0; Int input_format = -1; if( resolution.size() > 0 ) @@ -575,7 +575,7 @@ Bool PlaYUVerStream::seekInputRelative( Bool bIsFoward ) Bool PlaYUVerStream::seekInput( UInt64 new_frame_num ) { - if( !m_bInit || new_frame_num < 0 || new_frame_num >= m_uiTotalFrameNum || ( Int64 )new_frame_num == m_iCurrFrameNum ) + if( !m_bInit || new_frame_num >= m_uiTotalFrameNum || ( Int64 )new_frame_num == m_iCurrFrameNum ) return false; m_iCurrFrameNum = new_frame_num - 1;