Browse Source

Fix overflow

master 0.0.6
maze 2 years ago
parent
commit
9c90dce813
  1. 4
      animation.go

4
animation.go

@ -107,7 +107,7 @@ func (a *imageAnimation) NextFrame() (image.Image, time.Duration, error) {
pos := a.pos
if len(a.index) > 0 {
if pos > len(a.index) || pos > len(a.delay) {
if pos >= len(a.index) || pos >= len(a.delay) {
return nil, 0, io.EOF
}
a.pos++
@ -121,7 +121,7 @@ func (a *imageAnimation) NextFrame() (image.Image, time.Duration, error) {
}
// Linear.
if pos > len(a.frame) || pos > len(a.delay) {
if pos >= len(a.frame) || pos >= len(a.delay) {
return nil, 0, io.EOF
}
a.pos++

Loading…
Cancel
Save