buffered: Bug fix: Needed to copy pixels when buffering

Updates #983
This commit is contained in:
Hajime Hoshi 2019-11-16 16:38:55 +09:00
parent e42cff071c
commit 16b3a5c296

View File

@ -205,7 +205,9 @@ func (i *Image) ReplacePixels(pix []byte) {
delayedCommandsM.Lock()
if needsToDelayCommands {
delayedCommands = append(delayedCommands, func() {
i.img.ReplacePixels(pix)
copied := make([]byte, len(pix))
copy(copied, pix)
i.img.ReplacePixels(copied)
})
delayedCommandsM.Unlock()
return