mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-19 16:47:28 +01:00
Let gif "ignore too much" quirk skip lzw errors
The modified test/data/*/*.gif files differ by only one byte: 00000000 47 49 46 38 39 61 02 00 02 00 81 00 00 00 00 ff |GIF89a..........| 00000010 11 00 ff 22 00 ff 33 00 ff 2c 00 00 00 00 02 00 |..."..3..,......| -00000020 02 00 00 02 02 84 f1 00 3b |........;| +00000020 02 00 00 02 02 84 5d 00 3b |......].;| The etc-good-lzw.gif bits have changed, even though the etc-good-lzw.etc.txt file only had comments added, due to a Go standard library change: "compress/lzw: output a Clear code first, per GIF spec" https://github.com/golang/go/commit/9c1dbdf60edbffeff10f58af21fa055eb0fdd29f Updates PR #57 Updates https://crbug.com/1270631
This commit is contained in:
1 parent
3b882be500
commit
e44920d382
8 files changed
+110
-5
No files matched your search
@@ -954,6 +954,17 @@ pri func decoder.decode_id_part2?(dst: ptr base.pixel_buffer, src: base.io_reade
|
||||
continue.outer
|
||||
} else if lzw_status == base."$short write" {
|
||||
continue.inner
|
||||
} else if this.quirks[QUIRK_IGNORE_TOO_MUCH_PIXEL_DATA - QUIRKS_BASE] and
|
||||
(this.dst_y >= this.frame_rect_y1) and (this.interlace == 0) {
|
||||
// It's invalid LZW-compressed data, but we still have a full
|
||||
// frame and have opted in to QUIRK_IGNORE_TOO_MUCH_PIXEL_DATA,
|
||||
// so treat it like the lzw_status.is_ok() case, other than not
|
||||
// clearing this.previous_lzw_decode_ended_abruptly.
|
||||
if need_block_size or (block_size > 0) {
|
||||
args.src.skip_u32?(n: block_size as base.u32)
|
||||
this.skip_blocks?(src: args.src)
|
||||
}
|
||||
break.outer
|
||||
}
|
||||
return lzw_status
|
||||
} endwhile.inner
|
||||
|
||||
Reference in new issue
Block a user