1
1
mirror of https://github.com/wader/fq.git synced 2024-12-26 15:02:28 +03:00

Merge pull request #84 from wader/flac-dont-allow-zero-samplesize

flac: Don't allow zero subframe sample size
This commit is contained in:
Mattias Wadman 2022-01-18 12:03:54 +01:00 committed by GitHub
commit 51f958278e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -378,8 +378,8 @@ func frameDecode(d *decode.D, in interface{}) interface{} {
} }
subframeSampleSize := sampleSize - wastedBitsK subframeSampleSize := sampleSize - wastedBitsK
if subframeSampleSize < 0 { if subframeSampleSize < 1 {
d.Fatalf("negative subframeSampleSize %d", subframeSampleSize) d.Fatalf("subframeSampleSize %d < 1", subframeSampleSize)
} }
// if channel is side, add en extra sample bit // if channel is side, add en extra sample bit
// https://github.com/xiph/flac/blob/37e675b777d4e0de53ac9ff69e2aea10d92e729c/src/libFLAC/stream_decoder.c#L2040 // https://github.com/xiph/flac/blob/37e675b777d4e0de53ac9ff69e2aea10d92e729c/src/libFLAC/stream_decoder.c#L2040