From e9ee841fc1e1745482d104fa499d2209823c2bc3 Mon Sep 17 00:00:00 2001 From: Sauhard Pande Date: Thu, 6 Jul 2017 21:27:05 +0530 Subject: QCamer2:HAL3: VTS configurestream fix for invalid rotation value. Issue: ValidateStreamRotation was not checking invalid rotation values (-1) due to this vts test cases is failing. Fix: Added check for invalid rotation value (-1) in validatestreamR- otation. Change-Id: Ia14cad8974dc9086b59d87ba3e7aa2c80e89a5f7 Signed-off-by: Davide Garberi --- camera/QCamera2/HAL3/QCamera3HWI.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'camera') diff --git a/camera/QCamera2/HAL3/QCamera3HWI.cpp b/camera/QCamera2/HAL3/QCamera3HWI.cpp index 4acf761..14d15a5 100644 --- a/camera/QCamera2/HAL3/QCamera3HWI.cpp +++ b/camera/QCamera2/HAL3/QCamera3HWI.cpp @@ -1667,6 +1667,7 @@ int QCamera3HardwareInterface::configureStreamsPerfLocked( "stream size : %d x %d, stream rotation = %d", newStream->stream_type, newStream->format, newStream->width, newStream->height, newStream->rotation); + //if the stream is in the mStreamList validate it bool stream_exists = false; for (List::iterator it=mStreamInfo.begin(); @@ -10100,6 +10101,14 @@ int QCamera3HardwareInterface::validateStreamRotations( bool isZsl = (newStream->stream_type == CAMERA3_STREAM_BIDIRECTIONAL && isImplDef); + if(newStream->rotation == -1) { + LOGE("ERROR: Invalid stream rotation requested for stream" + "type %d and stream format: %d", newStream->stream_type, + newStream->format); + rc = -EINVAL; + break; + } + if (isRotated && (!isImplDef || isZsl)) { LOGE("Error: Unsupported rotation of %d requested for stream" "type:%d and stream format:%d", -- cgit v1.2.3