diff options
author | CNLohr <charles@cnlohr.com> | 2018-02-24 12:26:32 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-24 12:26:32 -0500 |
commit | 3fbd36f71cfe168ada14b8f58f023bb05e4d322b (patch) | |
tree | 0d830ad923f207d74cc8493e35757f22fc02369a /src/ootx_decoder.c | |
parent | 4da907623f5ce8a71ab9f5ec60112df45060b2aa (diff) | |
parent | dabb0764a080ad219e1bb477e8cf7386a1a4dc7c (diff) | |
download | libsurvive-3fbd36f71cfe168ada14b8f58f023bb05e4d322b.tar.gz libsurvive-3fbd36f71cfe168ada14b8f58f023bb05e4d322b.tar.bz2 |
Merge pull request #99 from jdavidberger/misc-bugfix
Fixed two minor / potential bugs
Diffstat (limited to 'src/ootx_decoder.c')
-rw-r--r-- | src/ootx_decoder.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/ootx_decoder.c b/src/ootx_decoder.c index 7bf7d7e..ad55f5b 100644 --- a/src/ootx_decoder.c +++ b/src/ootx_decoder.c @@ -182,8 +182,13 @@ union iFloat { float f; }; + +struct __attribute__((__packed__)) unaligned_16_t { + uint16_t v; +}; + float _half_to_float(uint8_t* data) { - uint16_t x = *(uint16_t*)data; + uint16_t x = ((struct unaligned_16_t*)data)->v; union iFloat fnum; fnum.f = 0; |