Skip to content
This repository was archived by the owner on Apr 2, 2023. It is now read-only.

Commit 81bb838

Browse files
committed
frames: Bug fix: crash at *Frame.stereo
Fixes #23
1 parent 22bc0be commit 81bb838

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

fuzzing_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,13 @@ func TestFuzzing(t *testing.T) {
8383
"00000000000000000000" +
8484
"00000000000000000000" +
8585
"00000000000000000000",
86+
// #23
87+
"\xff\xfb%S000000v000\x00\x010000" +
88+
"00000000000000000000" +
89+
"0000\xf4000000000000000" +
90+
"00000000000000000000" +
91+
"00000000000000000000" +
92+
"00000000000000000000",
8693
}
8794
for _, input := range inputs {
8895
b := &bytesReadCloser{bytes.NewReader([]byte(input))}

internal/frame/frame.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ func (f *Frame) stereoProcessIntensityShort(gr int, sfb int) {
327327
for win := 0; win < 3; win++ {
328328
// Check that((is_pos[sfb]=scalefac) != 7) => no intensity stereo
329329
is_pos := f.mainData.ScalefacS[gr][0][sfb][win]
330-
if is_pos != 7 {
330+
if is_pos < 7 {
331331
sfb_start := consts.SfBandIndicesSet[sfreq].S[sfb]*3 + win_len*win
332332
sfb_stop := sfb_start + win_len
333333
if is_pos == 6 { // tan((6*PI)/12 = PI/2) needs special treatment!

0 commit comments

Comments
 (0)