Fix mlw_codec build warnings
Fixed mlw_codec build warnings.
Signed-off-by: Fredrik Svedberg <fredrik.svedberg@arm.com>
Change-Id: I8ec8fb3b092cce0629c690677984549febf01adc
diff --git a/ethosu/mlw_codec/mlw_encode.c b/ethosu/mlw_codec/mlw_encode.c
index 3a03091..cac5e98 100644
--- a/ethosu/mlw_codec/mlw_encode.c
+++ b/ethosu/mlw_codec/mlw_encode.c
@@ -1101,9 +1101,9 @@
/* Then encode */
int output_length = 0;
- if (*padded_length > 0)
+ if (*padded_length > 0 && *padded_length <= INT32_MAX)
{
- output_length = mlw_encode(weights, *padded_length, outbuf, verbose);
+ output_length = mlw_encode(weights, (int)*padded_length, outbuf, verbose);
}
reorder_free(weights);