mirror of
https://github.com/team-infusion-developers/android_hardware_samsung.git
synced 2024-11-01 07:47:55 +00:00
libOMX: Prevent mediaserver crash when decoding unsupported videosize
Change-Id: I752ae2595982ffd1f9e547788d96fee9e908bf8a
This commit is contained in:
parent
94482bf33b
commit
bc63c3d685
1 changed files with 11 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue