fix: add metaint validation and mid-metadata truncation test

Made-with: Cursor
This commit is contained in:
cottongin
2026-03-10 01:22:31 -04:00
parent 45a946f829
commit 1a3a58b8f0
2 changed files with 25 additions and 0 deletions

View File

@@ -27,6 +27,7 @@ class IcyParser(
}
private fun parseWithMetadata(metaint: Int) {
require(metaint > 0) { "metaint must be positive, got $metaint" }
val audioBuf = ByteArray(metaint)
while (true) {
val audioRead = readFully(audioBuf, 0, metaint)