diff options
author | Jean-Marc Valin <jmvalin@amazon.com> | 2023-07-29 01:29:33 +0300 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@amazon.com> | 2023-07-29 01:29:33 +0300 |
commit | b50ddccf0e7c548803d079b21c5841bfd62939e9 (patch) | |
tree | 893f25f77f454459b1012f0dcdcfa98c553b4798 | |
parent | 8cc769ea3a7ea58e19424f450d72983337c332fc (diff) |
Fixes weights parsing with DISABLE_DEBUG_FLOAT
It's the name that's NULL when an array isn't found
-rw-r--r-- | dnn/parse_lpcnet_weights.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/dnn/parse_lpcnet_weights.c b/dnn/parse_lpcnet_weights.c index a12cf711..7413099b 100644 --- a/dnn/parse_lpcnet_weights.c +++ b/dnn/parse_lpcnet_weights.c @@ -84,14 +84,14 @@ static const void *find_array_entry(const WeightArray *arrays, const char *name) static const void *find_array_check(const WeightArray *arrays, const char *name, int size) { const WeightArray *a = find_array_entry(arrays, name); - if (a && a->size == size) return a->data; + if (a->name && a->size == size) return a->data; else return NULL; } static const void *opt_array_check(const WeightArray *arrays, const char *name, int size, int *error) { const WeightArray *a = find_array_entry(arrays, name); - *error = (a != NULL && a->size != size); - if (a && a->size == size) return a->data; + *error = (a->name != NULL && a->size != size); + if (a->name && a->size == size) return a->data; else return NULL; } |