From 2683f950a7bb7fe7414f6a37ddfc51f4b44fb246 Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Thu, 5 Sep 2024 22:14:40 +0300 Subject: [PATCH] return back after merge --- lib/subghz/subghz_file_encoder_worker.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/subghz/subghz_file_encoder_worker.c b/lib/subghz/subghz_file_encoder_worker.c index af9376db5..1b8d4b667 100644 --- a/lib/subghz/subghz_file_encoder_worker.c +++ b/lib/subghz/subghz_file_encoder_worker.c @@ -59,7 +59,16 @@ bool subghz_file_encoder_worker_data_parse(SubGhzFileEncoderWorker* instance, co // Parse next element int32_t duration; while(strint_to_int32(str, &str, &duration, 10) == StrintParseNoError) { - subghz_file_encoder_worker_add_level_duration(instance, duration); + if((duration < -1000000) || (duration > 1000000)) { + if(duration > 0) { + subghz_file_encoder_worker_add_level_duration(instance, (int32_t)100); + } else { + subghz_file_encoder_worker_add_level_duration(instance, (int32_t)-100); + } + //FURI_LOG_I("PARSE", "Number overflow - %d", duration); + } else { + subghz_file_encoder_worker_add_level_duration(instance, duration); + } if(*str == ',') str++; // could also be `\0` }