mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-21 00:47:28 +01:00
Add std/png "#unsupported PNG compression method"
This commit is contained in:
1 parent
7dd0dd264b
commit
417b03a0ad
3 files changed
+12
-9
No files matched your search
@@ -18,6 +18,7 @@ pub status "#bad chunk"
|
||||
pub status "#bad filter"
|
||||
pub status "#bad header"
|
||||
pub status "#missing palette"
|
||||
pub status "#unsupported PNG compression method"
|
||||
pub status "#unsupported PNG file"
|
||||
|
||||
pri status "#internal error: inconsistent chunk type"
|
||||
|
||||
@@ -374,7 +374,7 @@ pri func decoder.decode_ihdr?(src: base.io_reader) {
|
||||
// Compression.
|
||||
a8 = args.src.read_u8?()
|
||||
if a8 <> 0 {
|
||||
return "#bad header"
|
||||
return "#unsupported PNG compression method"
|
||||
}
|
||||
|
||||
// Filter.
|
||||
@@ -768,14 +768,14 @@ pri func decoder.decode_iccp?(src: base.io_reader) {
|
||||
}
|
||||
} endwhile
|
||||
|
||||
// The compression method byte must be zero.
|
||||
// Compression method.
|
||||
if this.chunk_length <= 0 {
|
||||
return "#bad chunk"
|
||||
}
|
||||
this.chunk_length -= 1
|
||||
c = args.src.read_u8?()
|
||||
if c <> 0 {
|
||||
return "#bad chunk"
|
||||
return "#unsupported PNG compression method"
|
||||
}
|
||||
|
||||
this.metadata_is_zlib_compressed = true
|
||||
@@ -1466,7 +1466,7 @@ pub func decoder.tell_me_more?(dst: base.io_writer, minfo: nptr base.more_inform
|
||||
}
|
||||
c = args.src.read_u8?()
|
||||
if (c <> 0) and this.metadata_is_zlib_compressed {
|
||||
return "#bad chunk"
|
||||
return "#unsupported PNG compression method"
|
||||
}
|
||||
|
||||
// Skip the language tag and translated keyword: two iterations
|
||||
@@ -1494,7 +1494,7 @@ pub func decoder.tell_me_more?(dst: base.io_writer, minfo: nptr base.more_inform
|
||||
this.chunk_length -= 1
|
||||
c = args.src.read_u8?()
|
||||
if c <> 0 {
|
||||
return "#bad chunk"
|
||||
return "#unsupported PNG compression method"
|
||||
}
|
||||
this.metadata_is_zlib_compressed = true
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user