mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-03 12:32:25 -06:00
[chore]: Bump golang.org/x/image from 0.9.0 to 0.11.0 (#2074)
This commit is contained in:
parent
c1375ca5c1
commit
aaa5985d7d
6 changed files with 48 additions and 17 deletions
14
vendor/golang.org/x/image/bmp/reader.go
generated
vendored
14
vendor/golang.org/x/image/bmp/reader.go
generated
vendored
|
|
@ -191,14 +191,22 @@ func decodeConfig(r io.Reader) (config image.Config, bitsPerPixel int, topDown b
|
|||
}
|
||||
switch bpp {
|
||||
case 8:
|
||||
if offset != fileHeaderLen+infoLen+256*4 {
|
||||
colorUsed := readUint32(b[46:50])
|
||||
// If colorUsed is 0, it is set to the maximum number of colors for the given bpp, which is 2^bpp.
|
||||
if colorUsed == 0 {
|
||||
colorUsed = 256
|
||||
} else if colorUsed > 256 {
|
||||
return image.Config{}, 0, false, false, ErrUnsupported
|
||||
}
|
||||
_, err = io.ReadFull(r, b[:256*4])
|
||||
|
||||
if offset != fileHeaderLen+infoLen+colorUsed*4 {
|
||||
return image.Config{}, 0, false, false, ErrUnsupported
|
||||
}
|
||||
_, err = io.ReadFull(r, b[:colorUsed*4])
|
||||
if err != nil {
|
||||
return image.Config{}, 0, false, false, err
|
||||
}
|
||||
pcm := make(color.Palette, 256)
|
||||
pcm := make(color.Palette, colorUsed)
|
||||
for i := range pcm {
|
||||
// BMP images are stored in BGR order rather than RGB order.
|
||||
// Every 4th byte is padding.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue