libOMX: Prevent mediaserver crash when decoding unsupported videosize

Change-Id: I752ae2595982ffd1f9e547788d96fee9e908bf8a
This commit is contained in:
Dominggoes Isakh 2018-03-30 19:33:51 +02:00
parent 94482bf33b
commit bc63c3d685

View file

@ -53,6 +53,7 @@
#undef SEC_LOG_TAG
#define SEC_LOG_TAG "SEC_H264_DEC"
#define SEC_LOG_OFF
#include "SEC_OSAL_Log.h"
#define H264_DEC_NUM_OF_EXTRA_BUFFERS 1
@ -968,6 +969,16 @@ OMX_ERRORTYPE SEC_MFC_H264_Decode_Nonblock(OMX_COMPONENTTYPE *pOMXComponent, SEC
#endif
FunctionIn();
if (pSECInputPort->portDefinition.format.video.nFrameWidth > 1920 ||
pSECInputPort->portDefinition.format.video.nFrameHeight > 1088) {
SEC_OSAL_Log(SEC_LOG_ERROR, "Unsupported video size: %d, %d.",
pSECInputPort->portDefinition.format.video.nFrameWidth,
pSECInputPort->portDefinition.format.video.nFrameHeight);
/* Decoding unsupported video size causes mediaserver to crash. */
/* Just don't decode frame to prevent other issues. */
ret = OMX_ErrorNone;
goto EXIT;
}
if (pH264Dec->hMFCH264Handle.bConfiguredMFC == OMX_FALSE) {
SSBSIP_MFC_CODEC_TYPE eCodecType = H264_DEC;