From 5c3f8915d1b7e42f75628ec4d0ca3526d812bcc8 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Mon, 21 Mar 2022 15:11:38 +0900 Subject: [PATCH] internal/atlas: add an argument check --- internal/atlas/image.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/atlas/image.go b/internal/atlas/image.go index 26f289ae4..5e29ac09a 100644 --- a/internal/atlas/image.go +++ b/internal/atlas/image.go @@ -563,6 +563,9 @@ func (i *Image) replacePixels(pix []byte, mask []byte) { px, py, pw, ph := i.regionWithPadding() if pix == nil { + if mask != nil { + panic("atlas: mask must be nil when pix is nil") + } i.backend.restorable.ReplacePixels(nil, nil, px, py, pw, ph) return }