From ee164a39774fec1d0d47dfc8ce31ab19cfa3397b Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 24 Jun 2013 03:42:13 -0400 Subject: [PATCH] Fix a case where a pointer was being used before its null check in MediaEngine.cpp --- Core/HW/MediaEngine.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Core/HW/MediaEngine.cpp b/Core/HW/MediaEngine.cpp index 03f2b5273a..92bc603a57 100644 --- a/Core/HW/MediaEngine.cpp +++ b/Core/HW/MediaEngine.cpp @@ -376,13 +376,14 @@ bool MediaEngine::stepVideo(int videoPixelMode) { return false; if (!m_pCodecCtx) return false; + if ((!m_pFrame)||(!m_pFrameRGB)) + return false; + updateSwsFormat(videoPixelMode); // TODO: Technically we could set this to frameWidth instead of m_desWidth for better perf. // Update the linesize for the new format too. We started with the largest size, so it should fit. m_pFrameRGB->linesize[0] = getPixelFormatBytes(videoPixelMode) * m_desWidth; - if ((!m_pFrame)||(!m_pFrameRGB)) - return false; AVPacket packet; int frameFinished; bool bGetFrame = false;