From 1be678231c7d1b7ebd83b26cec7d9b3bc88550d1 Mon Sep 17 00:00:00 2001 From: Lajos Molnar Date: Thu, 10 Aug 2017 07:04:14 -0700 Subject: [PATCH] SoftVideoDecoderOMXComponent: max-size can be less than size A component can be configured for size that is greater than the max size. In such case, configure for the larger of these. Bug: 37101765 Change-Id: I9bf3cd38e34cbedc00c54862d6782f2841ae2ee8 --- media/libstagefright/omx/SoftVideoDecoderOMXComponent.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/media/libstagefright/omx/SoftVideoDecoderOMXComponent.cpp b/media/libstagefright/omx/SoftVideoDecoderOMXComponent.cpp index 24ed9810d5..cb811a0791 100644 --- a/media/libstagefright/omx/SoftVideoDecoderOMXComponent.cpp +++ b/media/libstagefright/omx/SoftVideoDecoderOMXComponent.cpp @@ -182,11 +182,11 @@ void SoftVideoDecoderOMXComponent::updatePortDefinitions(bool updateCrop, bool u uint32_t SoftVideoDecoderOMXComponent::outputBufferWidth() { - return mIsAdaptive ? mAdaptiveMaxWidth : mWidth; + return max(mIsAdaptive ? mAdaptiveMaxWidth : 0, mWidth); } uint32_t SoftVideoDecoderOMXComponent::outputBufferHeight() { - return mIsAdaptive ? mAdaptiveMaxHeight : mHeight; + return max(mIsAdaptive ? mAdaptiveMaxHeight : 0, mHeight); } void SoftVideoDecoderOMXComponent::handlePortSettingsChange(