summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorHarish Mahendrakar <harish.mahendrakar@ittiam.com>2015-10-02 15:37:47 +0530
committerSteve Kondik <steve@cyngn.com>2015-11-07 12:07:29 -0800
commit1684b7ca345c22f7297952b9340e884c3f2dc2c6 (patch)
tree2a732db63ef590ee91639c1c9771f9f4a40d103d /media
parente79ee6494c2a1f2d3b1f1b1393ca85beee41a29d (diff)
downloadframeworks_av-1684b7ca345c22f7297952b9340e884c3f2dc2c6.zip
frameworks_av-1684b7ca345c22f7297952b9340e884c3f2dc2c6.tar.gz
frameworks_av-1684b7ca345c22f7297952b9340e884c3f2dc2c6.tar.bz2
SoftAVCDec: Added a check for unsupported resolutions
Change-Id: I97203353c7d026e02c8aad0f2c820a641e453c7c
Diffstat (limited to 'media')
-rw-r--r--media/libstagefright/codecs/avcdec/SoftAVCDec.cpp11
1 files changed, 11 insertions, 0 deletions
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);