From 290f91c323f40ddc98986ee6a3522447465ff34d Mon Sep 17 00:00:00 2001 From: tobi Date: Mon, 2 Sep 2024 15:08:07 +0200 Subject: [PATCH] allow overflow in imaging --- internal/media/imaging.go | 9 --------- 1 file changed, 9 deletions(-) diff --git a/internal/media/imaging.go b/internal/media/imaging.go index 487b41b5f..6a0fa694c 100644 --- a/internal/media/imaging.go +++ b/internal/media/imaging.go @@ -514,9 +514,6 @@ func (s *scanner) scan(x1, y1, x2, y2 int, dst []uint8) { } else { r = ^(r >> 31) } - if r > math.MaxUint8 { - panic("overflow r") - } g := yy1 - 22554*cb1 - 46802*cr1 if uint32(g)&0xff000000 == 0 { //nolint:gosec @@ -524,9 +521,6 @@ func (s *scanner) scan(x1, y1, x2, y2 int, dst []uint8) { } else { g = ^(g >> 31) } - if g > math.MaxUint8 { - panic("overflow g") - } b := yy1 + 116130*cb1 if uint32(b)&0xff000000 == 0 { //nolint:gosec @@ -534,9 +528,6 @@ func (s *scanner) scan(x1, y1, x2, y2 int, dst []uint8) { } else { b = ^(b >> 31) } - if b > math.MaxUint8 { - panic("overflow b") - } d := dst[j : j+4 : j+4] d[0] = uint8(r) // #nosec G115 -- Overflow desired.