From e140b31fbde8b3e9da99de2c094b80e37e47444c Mon Sep 17 00:00:00 2001 From: mahongpe Date: Fri, 6 Nov 2015 00:44:27 +0800 Subject: fix random SEGV issue which is caused by wild pointer in libmix When resolution changes, we should flush video video pipeline at first, then free surface buffers. Bug: 23160948 Change-Id: I84782d886d8a484c2131d0b3f529f82b9c6fd8c9 Signed-off-by: mahongpe --- videocodec/OMXVideoDecoderBase.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/videocodec/OMXVideoDecoderBase.cpp b/videocodec/OMXVideoDecoderBase.cpp index 6270cea..975ac4c 100644 --- a/videocodec/OMXVideoDecoderBase.cpp +++ b/videocodec/OMXVideoDecoderBase.cpp @@ -734,9 +734,10 @@ OMX_ERRORTYPE OMXVideoDecoderBase::HandleFormatChange(void) { this->ports[INPORT_INDEX]->SetPortDefinition(¶mPortDefinitionInput, true); this->ports[OUTPORT_INDEX]->SetPortDefinition(¶mPortDefinitionOutput, true); + ProcessorFlush(INPORT_INDEX); + mVideoDecoder->freeSurfaceBuffers(); - ProcessorFlush(INPORT_INDEX); this->ports[OUTPORT_INDEX]->ReportPortSettingsChanged(); mFormatChanged = false; -- cgit v1.2.3