diff --git a/CHANGELOG.md b/CHANGELOG.md index 1cabe54..c5c25a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,14 @@ single running list until the first versioned release. _Nothing yet._ +## 0.3.0 + +- **Fix a second voice-prompt crash** on the Screen Dim menu row: the item *label* + ("Screen Dim") is a raw literal, and the shared menu code voices labels via + `voicePromptsAppendLanguageString()`, which crashes on any pointer outside the + language table. That function now ignores non-language pointers, so a stray + literal is skipped instead of hard-faulting. (The dim value is still announced.) + ## 0.2.0 - **Fix crash** opening Display Options with **voice announcements on**: the Screen diff --git a/MDUV380_firmware/application/include/freetrxVersion.h b/MDUV380_firmware/application/include/freetrxVersion.h index e5e87b4..015e403 100644 --- a/MDUV380_firmware/application/include/freetrxVersion.h +++ b/MDUV380_firmware/application/include/freetrxVersion.h @@ -5,9 +5,9 @@ #define _FREETRX_VERSION_H_ #define FREETRX_VERSION_MAJOR 0 -#define FREETRX_VERSION_MINOR 2 +#define FREETRX_VERSION_MINOR 3 #define FREETRX_VERSION_PATCH 0 -#define FREETRX_VERSION "0.2.0" +#define FREETRX_VERSION "0.3.0" #endif // _FREETRX_VERSION_H_ diff --git a/MDUV380_firmware/application/source/functions/voicePrompts.c b/MDUV380_firmware/application/source/functions/voicePrompts.c index e7a7887..a105fbc 100644 --- a/MDUV380_firmware/application/source/functions/voicePrompts.c +++ b/MDUV380_firmware/application/source/functions/voicePrompts.c @@ -343,6 +343,15 @@ void voicePromptsAppendLanguageString(const char *languageStringAdd) return; } + // The prompt index is derived from the pointer's offset within the currentLanguage + // table, so a pointer that isn't actually inside that table (e.g. a raw string + // literal passed by mistake) would yield an out-of-range prompt and crash. Ignore it. + const char *languageBase = ¤tLanguage->LANGUAGE_NAME[0]; + if ((languageStringAdd < languageBase) || (languageStringAdd >= (languageBase + sizeof(*currentLanguage)))) + { + return; + } + voicePromptsAppendPrompt(NUM_VOICE_PROMPTS + ((languageStringAdd - currentLanguage->LANGUAGE_NAME) #if ! defined(HAS_COLOURS)