From 94796b459d4ab47eef8eafe0e15be2baa9d3c5eb Mon Sep 17 00:00:00 2001 From: strawmanbobi Date: Mon, 18 Nov 2019 22:53:31 +0800 Subject: [PATCH] fixed a possible issue in wind direction fetch --- src/ir_decoder/src/ir_decode.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ir_decoder/src/ir_decode.c b/src/ir_decoder/src/ir_decode.c index 5d3a811..c40b4b1 100644 --- a/src/ir_decoder/src/ir_decode.c +++ b/src/ir_decoder/src/ir_decode.c @@ -581,6 +581,9 @@ INT8 get_supported_wind_direction(UINT8 *supported_wind_direction) if (NULL != context) { *supported_wind_direction = (UINT8) (context->si.mode_count - 1); + if (*supported_wind_direction < 0) { + *supported_wind_direction = 0; + } return IR_DECODE_SUCCEEDED; } else