mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +01:00
audio/internal/convert/resampling: Better boundary check
This commit is contained in:
parent
8912563555
commit
1828830b4a
@ -131,12 +131,12 @@ func (r *Resampling) at(t int64) (float64, float64, error) {
|
|||||||
if startN < 0 {
|
if startN < 0 {
|
||||||
startN = 0
|
startN = 0
|
||||||
}
|
}
|
||||||
if r.size/4 < startN {
|
if r.size/4 <= startN {
|
||||||
startN = r.size / 4
|
startN = r.size/4 - 1
|
||||||
}
|
}
|
||||||
endN := int64(tInSrc) + windowSize + 1
|
endN := int64(tInSrc) + windowSize + 1
|
||||||
if r.size/4 < endN {
|
if r.size/4 <= endN {
|
||||||
endN = r.size / 4
|
endN = r.size/4 - 1
|
||||||
}
|
}
|
||||||
lv := 0.0
|
lv := 0.0
|
||||||
rv := 0.0
|
rv := 0.0
|
||||||
|
Loading…
Reference in New Issue
Block a user