From b4ec8d0558c78b94ec7bf09018a7bf653cfca525 Mon Sep 17 00:00:00 2001 From: Harish Mahendrakar Date: Fri, 2 Oct 2015 15:37:47 +0530 Subject: SoftAVCDec: Added a check for unsupported resolutions Bug: 24542936 Change-Id: I97203353c7d026e02c8aad0f2c820a641e453c7c --- media/libstagefright/codecs/avcdec/SoftAVCDec.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'media/libstagefright/codecs') diff --git a/media/libstagefright/codecs/avcdec/SoftAVCDec.cpp b/media/libstagefright/codecs/avcdec/SoftAVCDec.cpp index 7c5093e..8101f75 100644 --- a/media/libstagefright/codecs/avcdec/SoftAVCDec.cpp +++ b/media/libstagefright/codecs/avcdec/SoftAVCDec.cpp @@ -582,6 +582,17 @@ void SoftAVC::onQueueFilled(OMX_U32 portIndex) { IV_API_CALL_STATUS_T status; status = ivdec_api_function(mCodecCtx, (void *)&s_dec_ip, (void *)&s_dec_op); + bool unsupportedResolution = + (IVD_STREAM_WIDTH_HEIGHT_NOT_SUPPORTED == (s_dec_op.u4_error_code & 0xFF)); + + /* Check for unsupported dimensions */ + if (unsupportedResolution) { + ALOGE("Unsupported resolution : %dx%d", mWidth, mHeight); + notify(OMX_EventError, OMX_ErrorUnsupportedSetting, 0, NULL); + mSignalledError = true; + return; + } + bool resChanged = (IVD_RES_CHANGED == (s_dec_op.u4_error_code & 0xFF)); GETTIME(&mTimeEnd, NULL); -- cgit v1.1