Compare commits

..

2 commits

Author SHA1 Message Date
Marcus Kida
5646d2df11 Release 0.7.1
Fix a crash when navigating the Messages menu with voice prompts enabled:
menu strings added after the voice-prompt pack was built read past the end
of the table of contents and now play silence instead.

Bump version to 0.7.1.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-13 17:32:26 +02:00
Marcus Kida
9eceb10013 Fix crash announcing menu strings past the voice-prompt table
voicePromptsAppendLanguageString() turns a language-string pointer into a
prompt index (NUM_VOICE_PROMPTS + offset), and voicePromptsPlay() then reads
tableOfContents[index + 1]. Strings added after the voice-prompt pack was
built (the SMS menu entries) land past the 368-entry table, so the player
read off the end of the array and the radio crashed when the Messages menu
announced a submenu name with voice prompts enabled.

Clamp any index at or beyond the last table slot to PROMPT_SILENCE, so such
strings are simply not spoken. Also protects the pre-existing strings sitting
at the very end of the table.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-13 17:31:09 +02:00
3 changed files with 24 additions and 4 deletions

View file

@ -9,6 +9,14 @@ single running list until the first versioned release.
_Nothing yet._
## 0.7.1
- **Fix:** the radio **crashed** when navigating the Messages menu with voice
prompts enabled. Menu strings added after the voice-prompt pack was built map
to a table-of-contents slot that doesn't exist; the player read past the end
of the table. Such strings now play silence instead (also hardens the
pre-existing strings sitting at the end of the table).
## 0.7.0
- **DMR text messages (SMS)** — full ETSI/Motorola-TMS-compatible messaging:

View file

@ -6,8 +6,8 @@
#define FREETRX_VERSION_MAJOR 0
#define FREETRX_VERSION_MINOR 7
#define FREETRX_VERSION_PATCH 0
#define FREETRX_VERSION_PATCH 1
#define FREETRX_VERSION "0.7.0"
#define FREETRX_VERSION "0.7.1"
#endif // _FREETRX_VERSION_H_

View file

@ -352,13 +352,25 @@ void voicePromptsAppendLanguageString(const char *languageStringAdd)
return;
}
voicePromptsAppendPrompt(NUM_VOICE_PROMPTS +
int promptNumber = NUM_VOICE_PROMPTS +
((languageStringAdd - currentLanguage->LANGUAGE_NAME)
#if ! defined(HAS_COLOURS)
- ((languageStringAdd >= currentLanguage->theme_chooser) ?
((currentLanguage->theme_colour_picker_blue - currentLanguage->theme_chooser) + LANGUAGE_TEXTS_LENGTH) : 0)
#endif
) / LANGUAGE_TEXTS_LENGTH);
) / LANGUAGE_TEXTS_LENGTH;
// Language strings added after the voice prompt pack was built have no
// entry in the table of contents. voicePromptsPlay() reads TOC[promptNumber + 1],
// so anything at or past the last slot would read past the array and crash;
// play silence for those instead.
if ((promptNumber < 0) || (promptNumber >= (VOICE_PROMPTS_TOC_SIZE - 1)))
{
voicePromptsAppendPrompt(PROMPT_SILENCE);
return;
}
voicePromptsAppendPrompt(promptNumber);
}
void voicePromptsPlay(void)