From 91323ebe929969b8699a4016b8ff99cc038943ec Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Tue, 1 Apr 2014 21:24:38 -0700 Subject: [PATCH] Clear m_sws_ctx when freeing it. Oops. May help #5781. --- Core/HW/MediaEngine.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Core/HW/MediaEngine.cpp b/Core/HW/MediaEngine.cpp index bd9706092a..cdbcf54a3e 100644 --- a/Core/HW/MediaEngine.cpp +++ b/Core/HW/MediaEngine.cpp @@ -313,8 +313,8 @@ void MediaEngine::closeContext() m_pCodecCtxs.clear(); if (m_pFormatCtx) avformat_close_input(&m_pFormatCtx); - if (m_sws_ctx != NULL) - sws_freeContext(m_sws_ctx); + sws_freeContext(m_sws_ctx); + m_sws_ctx = NULL; m_pIOContext = 0; #endif m_buffer = 0; @@ -414,9 +414,7 @@ bool MediaEngine::setVideoDim(int width, int height) // Allocate video frame m_pFrame = av_frame_alloc(); - if (m_sws_ctx != NULL) { - sws_freeContext(m_sws_ctx); - } + sws_freeContext(m_sws_ctx); m_sws_ctx = NULL; m_sws_fmt = -1; updateSwsFormat(GE_CMODE_32BIT_ABGR8888);