feat: bump dependencies
# Conflicts: # go.mod # go.sum # vendor/modules.txt
This commit is contained in:
3 files changed
+3
-21
No files matched your search
+2
-14
@@ -214,9 +214,8 @@ func u32(b []byte) uint32 {
|
||||
// copying from the source to a caller-supplied buffer, and instead provide
|
||||
// direct access to the underlying []byte data.
|
||||
type source struct {
|
||||
b []byte
|
||||
r io.ReaderAt
|
||||
minSize int // r is known to contain at least minSize bytes
|
||||
b []byte
|
||||
r io.ReaderAt
|
||||
|
||||
// TODO: add a caching layer, if we're using the io.ReaderAt? Note that
|
||||
// this might make a source no longer safe to use concurrently.
|
||||
@@ -256,17 +255,6 @@ func (s *source) view(buf []byte, offset, length int) ([]byte, error) {
|
||||
return s.b[offset : offset+length], nil
|
||||
}
|
||||
|
||||
if end := offset + length; end > s.minSize && length > 1<<20 {
|
||||
// We're reading more than 1MiB, and we don't know whether
|
||||
// the file contains this data. Check that the data exists
|
||||
// before we try to allocate.
|
||||
var oneByte [1]byte
|
||||
if n, err := s.r.ReadAt(oneByte[:], int64(end)-1); err != nil || n != 1 {
|
||||
return nil, errInvalidBounds
|
||||
}
|
||||
s.minSize = end
|
||||
}
|
||||
|
||||
// Read from the io.ReaderAt.
|
||||
if length <= cap(buf) {
|
||||
buf = buf[:length]
|
||||
|
||||
-6
@@ -134,12 +134,6 @@ func decode(r io.Reader, configOnly bool) (image.Image, image.Config, error) {
|
||||
wantAlpha = (buf[0] & alphaBit) != 0
|
||||
widthMinusOne = uint32(buf[4]) | uint32(buf[5])<<8 | uint32(buf[6])<<16
|
||||
heightMinusOne = uint32(buf[7]) | uint32(buf[8])<<8 | uint32(buf[9])<<16
|
||||
if uint64(widthMinusOne+1)*uint64(heightMinusOne+1) > 1<<32-1 {
|
||||
// The product of _Canvas Width_ and _Canvas Height_ MUST be
|
||||
// at most 2^32 - 1.
|
||||
// https://www.rfc-editor.org/rfc/rfc9649.html#section-2.7-12
|
||||
return nil, image.Config{}, errInvalidFormat
|
||||
}
|
||||
if configOnly {
|
||||
if wantAlpha {
|
||||
return nil, image.Config{
|
||||
|
||||
Vendored
+1
-1
@@ -2281,7 +2281,7 @@ golang.org/x/exp/slices
|
||||
golang.org/x/exp/slog
|
||||
golang.org/x/exp/slog/internal
|
||||
golang.org/x/exp/slog/internal/buffer
|
||||
# golang.org/x/image v0.39.0
|
||||
# golang.org/x/image v0.38.0
|
||||
## explicit; go 1.25.0
|
||||
golang.org/x/image/bmp
|
||||
golang.org/x/image/ccitt
|
||||
|
||||
Reference in new issue
Block a user