mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 09:25:38 +00:00
internal/ops: avoid some bounds checks in decode
Signed-off-by: Egon Elbre <egonelbre@gmail.com>
This commit is contained in:
+2
-1
@@ -163,9 +163,10 @@ const (
|
||||
)
|
||||
|
||||
func (op *ClipOp) Decode(data []byte) {
|
||||
if OpType(data[0]) != TypeClip {
|
||||
if len(data) < TypeClipLen || OpType(data[0]) != TypeClip {
|
||||
panic("invalid op")
|
||||
}
|
||||
data = data[:TypeClipLen]
|
||||
bo := binary.LittleEndian
|
||||
r := image.Rectangle{
|
||||
Min: image.Point{
|
||||
|
||||
Reference in New Issue
Block a user