added sub-category check for binary open

This commit is contained in:
strawmanbobi
2020-03-08 19:47:10 +08:00
parent cae3ff8785
commit 3c0d06a9f4

View File

@@ -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;