IVGCVSW-3633 Fixed possible driver crash
authorMike Kelly <mike.kelly@arm.com>
Wed, 14 Aug 2019 10:33:11 +0000 (11:33 +0100)
committermike.kelly <mike.kelly@arm.com>
Wed, 14 Aug 2019 14:03:13 +0000 (14:03 +0000)
 * Fixed possible driver crash due to supportedTypes arrays with the wrong size.

Signed-off-by: Mike Kelly <mike.kelly@arm.com>
Change-Id: I52702b84089d02d3c63ff7aa5923a9f5628bec91

src/backends/reference/RefLayerSupport.cpp

index 56ca437..22d7914 100644 (file)
@@ -372,7 +372,7 @@ bool RefLayerSupport::IsConvolution2dSupported(const TensorInfo& input,
 
     if (biases.has_value())
     {
-        std::array<DataType,3> biasesSupportedTypes = {
+        std::array<DataType,2> biasesSupportedTypes = {
                 DataType::Float32,
                 DataType::Signed32
         };
@@ -471,8 +471,8 @@ bool RefLayerSupport::IsDequantizeSupported(const TensorInfo& input,
     supported &= CheckSupportRule(TypeAnyOf(input, supportedInputTypes), reasonIfUnsupported,
                                   "Reference dequantize: input type not supported.");
 
-    std::array<DataType,2> supportedOutputTypes = {
-        DataType::Float32,
+    std::array<DataType,1> supportedOutputTypes = {
+        DataType::Float32
     };
 
     supported &= CheckSupportRule(TypeAnyOf(output, supportedOutputTypes), reasonIfUnsupported,
@@ -491,7 +491,7 @@ bool RefLayerSupport::IsDetectionPostProcessSupported(const armnn::TensorInfo& i
 {
     bool supported = true;
 
-    std::vector<DataType> supportedInputTypes =
+    std::array<DataType,3> supportedInputTypes =
     {
         DataType::Float32,
         DataType::QuantisedAsymm8,
@@ -1603,7 +1603,7 @@ bool RefLayerSupport::IsTransposeConvolution2dSupported(const TensorInfo& input,
 
     if (biases.has_value())
     {
-        std::array<DataType,3> biasesSupportedTypes =
+        std::array<DataType,2> biasesSupportedTypes =
         {
                 DataType::Float32,
                 DataType::Signed32