Change softvpx buffer count to 10

Some cts tests made implicity assumption that the number of buffers
is less than 16. When the decoder has 16 or more input buffers, it
could queue more input buffers without blocking before the first
output comes out, tests waiting for the output might fail.

Changing buffer count to 10, as it still allows 60fps content to
buffer >150ms.

Also added a few missing OMX param check.

Test: Youtube/Exoplayer HDR 1080p60 playback (with media service
cpu set to top-app) and observe no framedrops;
Failing CTS test in bug.

bug: 75976396
bug: 76145803
Change-Id: Ie27583e6519a3dbadc7c993022a5af830fb250a9
diff --git a/media/libstagefright/codecs/on2/dec/SoftVPX.h b/media/libstagefright/codecs/on2/dec/SoftVPX.h
index 9ac2791..b62b526 100644
--- a/media/libstagefright/codecs/on2/dec/SoftVPX.h
+++ b/media/libstagefright/codecs/on2/dec/SoftVPX.h
@@ -44,7 +44,7 @@
 
 private:
     enum {
-        kNumBuffers = 16
+        kNumBuffers = 10
     };
 
     enum {
diff --git a/media/libstagefright/omx/SoftVideoDecoderOMXComponent.cpp b/media/libstagefright/omx/SoftVideoDecoderOMXComponent.cpp
index 8ef7620..cd0f75c 100644
--- a/media/libstagefright/omx/SoftVideoDecoderOMXComponent.cpp
+++ b/media/libstagefright/omx/SoftVideoDecoderOMXComponent.cpp
@@ -563,6 +563,10 @@
             DescribeColorAspectsParams* colorAspectsParams =
                     (DescribeColorAspectsParams *)params;
 
+            if (!isValidOMXParam(colorAspectsParams)) {
+                return OMX_ErrorBadParameter;
+            }
+
             if (colorAspectsParams->nPortIndex != kOutputPortIndex) {
                 return OMX_ErrorBadParameter;
             }
@@ -584,6 +588,10 @@
             DescribeHDRStaticInfoParams* hdrStaticInfoParams =
                     (DescribeHDRStaticInfoParams *)params;
 
+            if (!isValidOMXParam(hdrStaticInfoParams)) {
+                return OMX_ErrorBadParameter;
+            }
+
             if (hdrStaticInfoParams->nPortIndex != kOutputPortIndex) {
                 return OMX_ErrorBadPortIndex;
             }
@@ -635,15 +643,17 @@
             const DescribeHDRStaticInfoParams* hdrStaticInfoParams =
                     (DescribeHDRStaticInfoParams *)params;
 
+            if (!isValidOMXParam(hdrStaticInfoParams)) {
+                return OMX_ErrorBadParameter;
+            }
+
             if (hdrStaticInfoParams->nPortIndex != kOutputPortIndex) {
                 return OMX_ErrorBadPortIndex;
             }
 
-            if (hdrStaticInfoParams != NULL) {
-                mOutputFormat = OMX_COLOR_FormatYUV420Planar16;
-                mHdrStaticInfo = hdrStaticInfoParams->sInfo;
-                updatePortDefinitions(false);
-            }
+            mOutputFormat = OMX_COLOR_FormatYUV420Planar16;
+            mHdrStaticInfo = hdrStaticInfoParams->sInfo;
+            updatePortDefinitions(false);
 
             return OMX_ErrorNone;
         }