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

Commit

Permalink
frames: Bug fix: crash at *Frame.stereo
Browse files Browse the repository at this point in the history
Fixes #23
  • Loading branch information
hajimehoshi committed Feb 7, 2018
1 parent 22bc0be commit 81bb838
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions fuzzing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ func TestFuzzing(t *testing.T) {
"00000000000000000000" +
"00000000000000000000" +
"00000000000000000000",
// #23
"\xff\xfb%S000000v000\x00\x010000" +
"00000000000000000000" +
"0000\xf4000000000000000" +
"00000000000000000000" +
"00000000000000000000" +
"00000000000000000000",
}
for _, input := range inputs {
b := &bytesReadCloser{bytes.NewReader([]byte(input))}
Expand Down
2 changes: 1 addition & 1 deletion internal/frame/frame.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ func (f *Frame) stereoProcessIntensityShort(gr int, sfb int) {
for win := 0; win < 3; win++ {
// Check that((is_pos[sfb]=scalefac) != 7) => no intensity stereo
is_pos := f.mainData.ScalefacS[gr][0][sfb][win]
if is_pos != 7 {
if is_pos < 7 {
sfb_start := consts.SfBandIndicesSet[sfreq].S[sfb]*3 + win_len*win
sfb_stop := sfb_start + win_len
if is_pos == 6 { // tan((6*PI)/12 = PI/2) needs special treatment!
Expand Down

0 comments on commit 81bb838

Please sign in to comment.