fix out of bounds crash
This commit is contained in:
@@ -143,8 +143,8 @@ func recolorWaveformImage(img *image.NRGBA, cL, cR color.Color, oldProgress, new
|
|||||||
bnds := img.Rect.Bounds()
|
bnds := img.Rect.Bounds()
|
||||||
xMin, xMax := 0, bnds.Dx()
|
xMin, xMax := 0, bnds.Dx()
|
||||||
if !fullRecolor {
|
if !fullRecolor {
|
||||||
xMin = min(oldProgress, newProgress)
|
xMin = max(0, min(oldProgress, newProgress))
|
||||||
xMax = max(oldProgress, newProgress)
|
xMax = min(bnds.Dx(), max(oldProgress, newProgress))
|
||||||
}
|
}
|
||||||
for x := xMin; x < xMax; x++ {
|
for x := xMin; x < xMax; x++ {
|
||||||
for y := 0; y < bnds.Dy(); y++ {
|
for y := 0; y < bnds.Dy(); y++ {
|
||||||
|
|||||||
Reference in New Issue
Block a user