mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-18 16:32:11 +01:00
std/handsum: change version bits from 0x00 to 0x40
This commit is contained in:
1 parent
2d049080ac
commit
a6c89da981
6 files changed
+6
-6
No files matched your search
@@ -226,7 +226,7 @@ const uint8_t g_src_ptr__mona_lisa_21_32_th[] = {
|
||||
const size_t g_src_len__mona_lisa_21_32_th = 24;
|
||||
|
||||
const uint8_t g_src_ptr__mona_lisa_21_32_handsum[] = {
|
||||
0xfe, 0xd7, 0x34, 0x17, 0x6f, 0xef, 0x00, 0x08, 0xa9, 0xfb, 0x6a, 0xf0,
|
||||
0xfe, 0xd7, 0x74, 0x17, 0x6f, 0xef, 0x00, 0x08, 0xa9, 0xfb, 0x6a, 0xf0,
|
||||
0x1d, 0xff, 0xf0, 0xa0, 0xcb, 0xe2, 0x04, 0x4f, 0xad, 0xfa, 0xfb, 0x0c,
|
||||
0x2e, 0x26, 0xf9, 0x8a, 0x6f, 0xac, 0x9f, 0xbf, 0xc8, 0x67, 0x90, 0xc9,
|
||||
0x7b, 0x89, 0x77, 0x88, 0x96, 0x6a, 0x75, 0x75, 0x87, 0x87, 0x88, 0xa9,
|
||||
|
||||
@@ -111,7 +111,7 @@ func Encode(w io.Writer, src image.Image, options *EncodeOptions) error {
|
||||
buf := [FileSize]byte{}
|
||||
buf[0] = Magic[0]
|
||||
buf[1] = Magic[1]
|
||||
buf[2] = aspectRatio
|
||||
buf[2] = aspectRatio | 0x40
|
||||
|
||||
bitOffset := 3 * 8
|
||||
for i := range dstI16s {
|
||||
@@ -192,7 +192,7 @@ func DecodeConfig(r io.Reader) (image.Config, error) {
|
||||
return image.Config{}, err
|
||||
} else if (buf[0] != Magic[0]) || (buf[1] != Magic[1]) {
|
||||
return image.Config{}, ErrNotAHandsumFile
|
||||
} else if (buf[2] & 0xC0) != 0 {
|
||||
} else if (buf[2] & 0xC0) != 0x40 {
|
||||
return image.Config{}, ErrUnsupportedFileVersion
|
||||
}
|
||||
|
||||
@@ -211,7 +211,7 @@ func Decode(r io.Reader) (image.Image, error) {
|
||||
return nil, err
|
||||
} else if (buf[0] != Magic[0]) || (buf[1] != Magic[1]) {
|
||||
return nil, ErrNotAHandsumFile
|
||||
} else if (buf[2] & 0xC0) != 0 {
|
||||
} else if (buf[2] & 0xC0) != 0x40 {
|
||||
return nil, ErrUnsupportedFileVersion
|
||||
}
|
||||
|
||||
|
||||
@@ -50863,7 +50863,7 @@ wuffs_handsum__decoder__do_decode_image_config(
|
||||
uint32_t t_1 = *iop_a_src++;
|
||||
v_c32 = t_1;
|
||||
}
|
||||
if ((v_c32 & 192u) != 0u) {
|
||||
if ((v_c32 & 192u) != 64u) {
|
||||
status = wuffs_base__make_status(wuffs_handsum__error__unsupported_handsum_file);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ pri func decoder.do_decode_image_config?(dst: nptr base.image_config, src: base.
|
||||
return "#bad header"
|
||||
}
|
||||
c32 = args.src.read_u8_as_u32?()
|
||||
if (c32 & 0xC0) <> 0x00 {
|
||||
if (c32 & 0xC0) <> 0x40 {
|
||||
return "#unsupported Handsum file"
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in new issue
Block a user