From 3c0d06a9f4bd14dda539c0f31d8b3e28ce60a1d2 Mon Sep 17 00:00:00 2001 From: strawmanbobi Date: Sun, 8 Mar 2020 19:47:10 +0800 Subject: [PATCH] added sub-category check for binary open --- src/ir_decoder/src/ir_decode.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ir_decoder/src/ir_decode.c b/src/ir_decoder/src/ir_decode.c index 1f434d1..26c864c 100644 --- a/src/ir_decoder/src/ir_decode.c +++ b/src/ir_decoder/src/ir_decode.c @@ -178,9 +178,15 @@ INT8 ir_binary_open(const UINT8 category, const UINT8 sub_category, UINT8* binar ir_printf("wrong remote category\n"); return IR_DECODE_FAILED; } - remote_category = category; + if (sub_category < SUB_CATEGORY_QUATERNARY || + sub_category >= SUB_CATEGORY_NEXT) + { + ir_printf("wrong remote sub category : %d\n", sub_category); + return IR_DECODE_FAILED; + } + if (category == REMOTE_CATEGORY_AC) { ir_binary_type = IR_TYPE_STATUS;