Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

P2: A 15-stage briefing reads past the voice array on the objectives slide

Open Beginner friendly
#7,918 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
83/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
cpp
Domain
game-dev

Research direction

The report identifies brief_render in missionbrief.cpp and brief_voice_play in missionbriefcommon.cpp; start by reading those call sites and how briefing stages and the objectives slide are indexed. Reproduce with a 15-stage briefing and briefing voice enabled, ideally under AddressSanitizer. Done when the objectives slide displays without an out-of-bounds read or invalid voice handle.

Written by the indexing model from the issue text.

Description

Problem

A briefing with the maximum 15 stages reads past the end of the briefing voice array when the player reaches the objectives slide. The objectives slide is shown as an extra stage after the last one, so its index is 15, but the voice handle array only has 15 entries (0 to 14). The value read from just past the array is then treated as a voice stream handle.

Steps to reproduce

  1. FSO master (tested on 12a36dc1a with an ASan debug build; the briefing files are unchanged on current master 76219fd1e), Linux, MediaVPs 5.0.2, briefing voice enabled (the default).
  2. A single-player mission whose briefing has 15 stages ($num_stages: 15) and that shows the goals slide (normal missions do).
  3. Start the mission and step through the briefing with the Right arrow to the objectives slide.

Expected vs. actual behavior

Expected: the objectives slide shows normally.

Actual: AddressSanitizer reports a global-buffer-overflow read in brief_voice_play (missionbriefcommon.cpp:2489), called from brief_render (missionbrief.cpp:1188), at 0 bytes after Brief_voices (60 bytes, 15 entries). In a normal build the out-of-range value may be used as a stream handle (from reading the code).

Proposed fixes

  1. Don't play a voice for the objectives slide. In brief_render, only call brief_voice_play when the current stage is a real briefing stage (less than the briefing's stage count). Small and local.
  2. Bounds-check inside the voice functions. Have brief_voice_play and its siblings return early for a stage index at or past the array size.
  3. Size the array for the extra slide. Give the voice array one more slot than MAX_BRIEF_STAGES, kept at -1 so the objectives slide simply has no voice.
Dominant language
C++
Stars
488
Forks
184
Avg merge
2d 9h
Merged PRs (30d)
40

Getting set up

We have not checked this project's setup files yet. Start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from scp-fs2open/fs2open.github.com

All issues in scp-fs2open/fs2open.github.com

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.