diff --git a/extern/osg-ffmpeg-videoplayer/videostate.cpp b/extern/osg-ffmpeg-videoplayer/videostate.cpp index 4dd618858..dea08de92 100644 --- a/extern/osg-ffmpeg-videoplayer/videostate.cpp +++ b/extern/osg-ffmpeg-videoplayer/videostate.cpp @@ -721,7 +721,12 @@ void VideoState::deinit() avformat_close_input(&this->format_ctx); } - mTexture = NULL; + if (mTexture) + { + // reset Image separately, it's pointing to *this and there might still be outside references to mTexture + mTexture->setImage(NULL); + mTexture = NULL; + } } double VideoState::get_external_clock()