Skip to content

Commit e15f3b5

Browse files
invalid width/height check on resize
1 parent cfc19d4 commit e15f3b5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

canvas.go

+3
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,9 @@ func (canvas *DrawingCanvas) Resize(width, height int) {
148148
if prevWidth == width && prevHeight == height {
149149
return
150150
}
151+
if width < 1 || height < 1 {
152+
log.Panicf("INVALID RESIZE SIZE - (%d x %d)\n", width, height)
153+
}
151154
if canvas.image == nil {
152155
log.Panicln("WHY is canvas image INVALID!!!")
153156
}

0 commit comments

Comments
 (0)