Closed Mindavi closed 1 year ago
I guess an exponent greater that 3 won't make sense there: three digits, three zeros gives the maximum sensible range for lux. But there's also lots of unchecked BCD in there, maybe we should test all that for plausibility too?
Haven't lookes into this yet, but the undefined behavior is solved in ff3482e. This is now at least defined behavior, albeit probably still incorrect.
We can not check every value in every decoder. Code should not crash or be undefined but trusting values are up to the user. We make a best effort and then leave at that but if someone wants to add more check I will not reject patches.
Not sure how to fix this, maybe unsigned may be used to ensure it's not undefined behaviour but defined behaviour. At least reporting it so this can be picked up eventually.
rtl_433 -y {124}07875957Cd90cc3a8a03599f3fdaef9
will trigger this, make sure ASAN is compiled in.Maybe a sanity check for the brightness value might also be good,
2084139008
doesn't seem right either way.