Validate audio configuration values

This commit is contained in:
Brandon McGinty (chatgpt)
2026-08-09 14:22:46 -04:00
committed by Brandon McGinty
parent 82440b7670
commit 626608c997
4 changed files with 43 additions and 3 deletions
+3 -3
View File
@@ -182,20 +182,20 @@ Priority 2: protocol and data correctness
is 2x/4x/6x too high. Calculate bits per frame divided by the actual
Config.AudioInterval, or set the bitrate once when configuration changes.
23. AudioInterval accepts invalid values
[x] 23. AudioInterval accepts invalid values
File: gumble/gumble/config.go
AudioFrameSize truncates arbitrary intervals to a count of 10 ms frames,
while the ticker still uses the original interval. Validate and reject
values other than 10/20/40/60 ms (and validate AudioDataBytes/Buffers).
24. Legacy/custom varint has a MinInt64 recursion failure
[x] 24. Legacy/custom varint has a MinInt64 recursion failure
File: gumble/gumble/varint/write.go
Encoding math.MinInt64 evaluates -value to the same negative number and
recursively encodes forever until panic. Handle MinInt64 explicitly or
encode negatives using an unsigned magnitude without overflow. Validate
output buffer capacity in the exported encoder too.
25. Mumble version layout documentation is wrong
[x] 25. Mumble version layout documentation is wrong
File: gumble/gumble/version.go
The comment says major uses bits 0-15, but SemanticVersion and ClientVersion
use bits 16-31. Correct the documentation and add known version tests.