diff options
author | Won Jeon <won.jeon@arm.com> | 2023-06-07 18:09:40 +0000 |
---|---|---|
committer | Won Jeon <won.jeon@arm.com> | 2023-06-07 18:41:33 +0000 |
commit | 0df9a1cdff1c25a01bc15ba2acc8307217bcaa02 (patch) | |
tree | ecbe39b1c34ba53bc2e8f4b73a5be60a01758296 /include | |
parent | 8a2704330c18532d79a65ad2733458a80bf9c5b8 (diff) | |
download | serialization_lib-0df9a1cdff1c25a01bc15ba2acc8307217bcaa02.tar.gz |
Add u8 array to float conversion check
Signed-off-by: Won Jeon <won.jeon@arm.com>
Change-Id: Idfd668b0ce8f8f587e00ca7b03063ce58d789ac4
Diffstat (limited to 'include')
-rw-r--r-- | include/attribute.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/attribute.h b/include/attribute.h index 952b030..1a19f62 100644 --- a/include/attribute.h +++ b/include/attribute.h @@ -67,7 +67,7 @@ inline int convertFlatbuffersU8toF32(const flatbuffers::Vector<uint8_t>& in, uin #define DEF_ARGS_VER0_S_float_as_bytes(V) \ { \ std::vector<float> attr_vec; \ - if (convertFlatbuffersU8toF32(*(p->V()), 1, attr_vec)) \ + if (p->V() && convertFlatbuffersU8toF32(*(p->V()), 1, attr_vec)) \ assert(0 && "Failed to convert u8 buffer to f32"); \ _##V = (!attr_vec.empty()) ? attr_vec[0] : 0.0f; \ } |