Skip to content

Commit ae4047c

Browse files
tools: plugin: ov_noise_suppression: address review feedback
Replace the magic number (1u << 24) with a descriptive macro NS_MAX_SHAPE_DIM at both validation sites in the noise suppression interface. This makes the intent of the upper bound self-documenting. Update the test copyright header: set the year to 2026 (current) and attribute authorship to a real name and email rather than the anonymous "Security Team" placeholder, per project convention. Signed-off-by: OrbisAI Security <mediratta01.pally@gmail.com>
1 parent 3ead62e commit ae4047c

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

tools/plugin/modules/ov_noise_suppression/noise_suppression_interface.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
#include "noise_suppression_interface.h"
1414
#define NS_MAX_SOURCE_CHANNELS 2
15+
#define NS_MAX_SHAPE_DIM (1u << 24)
1516

1617
extern "C" {
1718
struct ns_data {
@@ -86,7 +87,7 @@ extern "C" {
8687

8788
nd->inp_shape = nd->model->input("input").get_shape();
8889
for (auto dim : nd->inp_shape)
89-
if (!dim || dim > (1u << 24))
90+
if (!dim || dim > NS_MAX_SHAPE_DIM)
9091
return -EINVAL;
9192

9293
return 0;
@@ -145,7 +146,7 @@ extern "C" {
145146

146147
state_shape = nd->model->input(inp_state_name).get_shape();
147148
for (auto dim : state_shape)
148-
if (!dim || dim > (1u << 24))
149+
if (!dim || dim > NS_MAX_SHAPE_DIM)
149150
return -EINVAL;
150151
if (nd->iter > 0) {
151152
/*

tools/plugin/modules/ov_noise_suppression/test_ns_shape_validation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// SPDX-License-Identifier: BSD-3-Clause
22
//
3-
// Copyright(c) 2024 Intel Corporation. All rights reserved.
3+
// Copyright(c) 2026 Intel Corporation. All rights reserved.
44
//
5-
// Author: Security Team
5+
// Author: Pally Mediratta <mediratta01.pally@gmail.com>
66

77
#include <cstdio>
88
#include <cstdlib>

0 commit comments

Comments
 (0)