Fixed possible crash when opening a video file