Skip to content

Commit 837143e

Browse files
authored
Fix OOB
Security fix. Array index out of bounds
1 parent db6af61 commit 837143e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

libspeex/vorbis_psy.c

+5-2
Original file line numberDiff line numberDiff line change
@@ -342,11 +342,14 @@ VorbisPsy *vorbis_psy_init(int rate, int n)
342342
inthalfoc=(int)halfoc;
343343
del=halfoc-inthalfoc;
344344

345+
if (halfoc < P_BANDS-1) {
345346
p->noiseoffset[i]=
346347
p->vi->noiseoff[inthalfoc]*(1.-del) +
347348
p->vi->noiseoff[inthalfoc+1]*del;
348-
349-
}
349+
} else {
350+
p->noiseoffset[i]=
351+
p->vi->noiseoff[inthalfoc]*(1.-del);
352+
}
350353
#if 0
351354
_analysis_output_always("noiseoff0",ls,p->noiseoffset,n,1,0,0);
352355
#endif

0 commit comments

Comments
 (0)