// SPDX-FileCopyrightText: © 2026 Jeffrey C. Ollie // SPDX-License-Identifier: MIT //! What the decoders must do with input nobody wrote. //! //! An image decoder is the most exposed code in a program that displays //! pictures: it parses a binary structure chosen by whoever supplied the file, //! does arithmetic on lengths that came out of that structure, and is reached //! by every image from anywhere. So the properties here are not "this file //! decodes to that image" — the tests in `tests/roundtrip.zig` are for that — //! but "whatever arrives, the decoder terminates, allocates within its limits, //! stays inside its buffers, and either fails or produces something that can //! be written back out and read again". //! //! Three properties, in rough order of how much they are worth: //! //! * **It comes back.** No panic, no hang, no leak, no allocation beyond what //! `Limits` allowed. This is the one that matters; everything an attacker //! wants from a decoder is on the other side of breaking it. //! * **A success survives a round trip.** If a decode claims to have //! understood the input, encoding the result and decoding that again gives //! the same picture. This is what catches a decoder and an encoder that have //! drifted apart, which no test written against a fixed example can see. //! * **Probing agrees with decoding.** `probe` reads the header and stops, and //! `decode` reads the header and goes on. If the two ever disagree about how //! large an image is, a caller who trusted the cheap answer has been misled //! about how much memory the expensive one will take. //! //! The limits are deliberately tiny here. A fuzzer will find a header claiming //! a 65535×65535 image within a few thousand inputs, and the interesting thing //! about that input is that it is *refused*, not that the machine spends a //! minute allocating sixteen gigabytes to find out. //! //! Each target is an ordinary test as well as a fuzz target. Without `--fuzz` //! it runs the corpus beside it, so `zig build test` exercises the same //! properties on input that has already been interesting once. //! //! `zig build fuzz --fuzz` hands them to Zig's fuzzer, and `tools/fuzz.zig` //! drives the same targets from a corpus of real files. const builtin = @import("builtin"); const std = @import("std"); const Io = std.Io; const mem = std.mem; const testing = std.testing; const Allocator = std.mem.Allocator; const Smith = std.testing.Smith; const z2d = @import("z2d"); const z2dimg = @import("z2dimg"); /// The allocator the targets run against. /// /// Under `zig build test` that is the testing allocator, which reports a leak /// as a failure. `tools/fuzz.zig` cannot name it — it is not a test build — /// so it sets this to a checked allocator of its own instead. pub var backing: Allocator = if (builtin.is_test) testing.allocator else undefined; /// Small enough that a header claiming an enormous image is refused in /// microseconds rather than allocated for. const limits: z2dimg.Limits = .{ .max_width = 256, .max_height = 256, .max_pixels = 4096, // Likewise small, so that a chunk claiming a megabyte of colour profile is // refused rather than allocated for --- and so that the path where the // budget runs out is the common one here rather than the rare one. .max_icc_bytes = 8192, }; /// A fuzz target: a property, the inputs it is worth starting from, and how /// many bytes of content its `Smith` reads. pub const Target = struct { name: []const u8, run: *const fn ([]const u8) anyerror!void, corpus: []const []const u8, /// The buffer the target hands `Smith.slice`, which the generator has to /// know: a length larger than the buffer yields an *empty* slice rather /// than a truncated one, so a generator that writes a bigger length is /// silently fuzzing nothing. content_max: usize, /// Restores whatever internal consistency the format needs before a /// decoder will look past its front door — for PNG, the chunk checksums. /// /// Without this the fuzzer mostly tests checksum verification. Measured /// over twenty thousand mutants of real PNGs: 74% still had the signature /// and **1.9%** still had valid CRCs, so 97% of everything that looked /// like a PNG was refused before a single scanline was unfiltered. The /// driver repairs most mutants and leaves some alone, so the rejection /// path stays covered too. repair: ?*const fn (bytes: []u8) void = null, /// Bytes worth mutating towards, for this format. Mutating a field into /// *another value the format defines* reaches a different branch; mutating /// it into noise mostly reaches the same refusal again. interesting: []const u8 = generic_interesting, }; /// A reasonable default: the ends of a byte, and the small integers that are /// a length or a count in any format. pub const generic_interesting = &[_]u8{ 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 15, 16, 24, 31, 32, 63, 64, 99, 127, 128, 129, 191, 192, 254, 255, 255, }; /// BMP: the DIB header lengths that identify a version, the bit depths, the /// compression numbers, and the run-length escapes. pub const bmp_interesting = &[_]u8{ 12, 16, 40, 52, 56, 64, 108, 124, 1, 2, 3, 4, 5, 6, 8, 16, 24, 32, 0, 0, 1, 2, 0x7f, 0x80, 0x81, 0xfe, 0xff, 0xff, 'B', 'M', }; /// PNG: the colour types and bit depths, the filter numbers, and the letters /// the chunk types are spelled with — a mutation that turns `tEXt` into `tRNS` /// reaches somewhere new, where one that turns it into noise does not. pub const png_interesting = &[_]u8{ 0, 1, 2, 3, 4, 6, 8, 16, 'I', 'H', 'D', 'R', 'A', 'T', 'E', 'N', 'P', 'L', 'T', 'E', 't', 'R', 'N', 'S', 0x78, 0x9c, 0x01, 0x00, 0xff, 0xff, }; /// JPEG: `0xFF` and the markers behind it, the sampling factors, and the /// quantisation and Huffman table identifiers. pub const jpeg_interesting = &[_]u8{ 0xff, 0xff, 0xff, 0x00, 0xc0, 0xc1, 0xc2, 0xc4, 0xc9, 0xcc, 0xd8, 0xd9, 0xda, 0xdb, 0xdd, 0xe0, 0xee, 0xfe, 0xd0, 0xd7, 0x11, 0x21, 0x22, 0x12, 0x01, 0x02, 0x03, 0, 1, 8, 63, 0x3f, 0x10, }; /// Recomputes every chunk checksum in a PNG, so that a mutation inside a chunk /// is seen by the decoder rather than by the CRC check. /// /// Walks as far as the lengths allow and stops where they stop making sense; a /// mutant whose chunk length was itself mutated is still a malformed file, and /// should be. pub fn repairPng(bytes: []u8) void { const signature = "\x89PNG\r\n\x1a\n"; if (bytes.len < signature.len) return; if (!mem.eql(u8, bytes[0..signature.len], signature)) return; var o: usize = signature.len; while (o + 12 <= bytes.len) { const len = mem.readInt(u32, bytes[o..][0..4], .big); if (len > bytes.len - o - 12) return; var crc: std.hash.Crc32 = .init(); crc.update(bytes[o + 4 ..][0 .. 4 + len]); mem.writeInt(u32, bytes[o + 8 + len ..][0..4], crc.final(), .big); o += 12 + len; } } const content_max = 4096; // -- the corpus -------------------------------------------------------------- /// One well-formed file of every shape the BMP decoder has a branch for. /// /// Mutating a real file is what stands in for coverage feedback: random bytes /// almost never survive the two-byte signature, let alone reach the pixel data, /// and a fuzzer that never gets past the signature is testing the signature. const bmp_corpus = [_][]const u8{ // 24-bit, the ordinary case &[_]u8{ 0x42, 0x4d, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, }, // 24-bit, top-down &[_]u8{ 0x42, 0x4d, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x01, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, }, // 8-bit, indexed &[_]u8{ 0x42, 0x4d, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x02, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, }, // 4-bit, indexed &[_]u8{ 0x42, 0x4d, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x23, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, }, // 1-bit, indexed &[_]u8{ 0x42, 0x4d, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, }, // 16-bit, the implied 5-5-5 layout &[_]u8{ 0x42, 0x4d, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xe0, 0x03, }, // 16-bit, explicit 5-6-5 masks after the header &[_]u8{ 0x42, 0x4d, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xe0, 0x07, }, // 32-bit, no alpha &[_]u8{ 0x42, 0x4d, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x37, 0x00, 0xff, 0x00, 0x00, }, // 32-bit, a V3 header with an alpha mask &[_]u8{ 0x42, 0x4d, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0x80, }, // run-length encoded, eight bits &[_]u8{ 0x42, 0x4d, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x04, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x01, 0x02, 0x03, 0x00, 0x01, }, // run-length encoded, four bits &[_]u8{ 0x42, 0x4d, 0x4a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x04, 0x01, 0x00, 0x01, }, // run-length encoded, with a delta &[_]u8{ 0x42, 0x4d, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x01, 0x03, 0x00, 0x02, 0x02, 0x01, 0x01, 0x03, 0x00, 0x01, }, // the twelve-byte OS/2 header &[_]u8{ 0x42, 0x4d, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x02, 0x00, 0x01, 0x00, 0x18, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, }, // And a few that are not images at all, so that the paths taken by a // refusal are exercised too. "", "BM", "\x89PNG\r\n\x1a\n", "not an image", }; /// The PNG corpus: a subset of the refereed fixtures, chosen to reach as many /// branches as a dozen files can. /// /// A PNG is much harder to reach the inside of by mutation than a BMP is. Past /// the signature there is a length-tagged chunk whose checksum has to match, /// and past that a zlib stream whose Adler-32 has to match, so a random bit /// flip almost always lands on "corrupt" rather than on an interesting /// decision. Starting from files that already parse is not an optimisation /// here, it is the difference between fuzzing the decoder and fuzzing the CRC. const png_corpus = [_][]const u8{ // eight-bit truecolour, unfiltered "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44" ++ "\x52\x00\x00\x00\x04\x00\x00\x00\x03\x08\x02\x00\x00\x00\x3b" ++ "\x96\x39\x91\x00\x00\x00\x22\x49\x44\x41\x54\x78\x9c\x63\xf8" ++ "\xcf\xc0\xc0\x00\xc6\x40\xc0\x00\xa6\xc1\x6c\xa0\x18\x97\x88" ++ "\x9c\x86\x91\x8d\x5b\x40\xd4\x89\x4b\x77\x00\x35\xa0\x10\x2d" ++ "\xfd\xb0\x8c\x85\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60" ++ "\x82", // eight-bit truecolour with alpha "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44" ++ "\x52\x00\x00\x00\x04\x00\x00\x00\x03\x08\x06\x00\x00\x00\xb4" ++ "\xf4\xae\xc6\x00\x00\x00\x2c\x49\x44\x41\x54\x78\x9c\x63\xf8" ++ "\xcf\xc0\xf0\x1f\x0c\x19\xfe\x83\x01\x03\x03\x98\x05\x12\x02" ++ "\x53\xff\x19\xb8\x44\xe4\xfe\x6b\x18\xd9\x34\xb8\x05\x44\x31" ++ "\x9c\xb8\x74\xc7\x01\x00\xb1\x12\x19\xe4\xce\xc0\x9e\xd3\x00" ++ "\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82", // eight-bit greyscale "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44" ++ "\x52\x00\x00\x00\x04\x00\x00\x00\x03\x08\x00\x00\x00\x00\x91" ++ "\x9f\xf1\x1a\x00\x00\x00\x17\x49\x44\x41\x54\x78\x9c\x63\x60" ++ "\x70\x68\xf8\xcf\xa0\x90\xb0\xe0\x01\x03\x87\xc0\x87\x1f\x00" ++ "\x25\x2c\x05\xc0\xcb\x03\x7a\x36\x00\x00\x00\x00\x49\x45\x4e" ++ "\x44\xae\x42\x60\x82", // eight-bit indexed "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44" ++ "\x52\x00\x00\x00\x04\x00\x00\x00\x03\x08\x03\x00\x00\x00\x83" ++ "\x2a\x5e\xf4\x00\x00\x00\x12\x50\x4c\x54\x45\xff\x00\x00\x00" ++ "\xff\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x80\x80\x80\x65" ++ "\xa4\xb0\x30\x00\x00\x00\x17\x49\x44\x41\x54\x78\x9c\x63\x60" ++ "\x60\x64\x62\x66\x60\x61\x65\x60\x64\x60\x62\x66\x61\x05\x00" ++ "\x00\xc5\x00\x1f\xf6\xbe\x47\x7a\x00\x00\x00\x00\x49\x45\x4e" ++ "\x44\xae\x42\x60\x82", // indexed, with tRNS giving per-entry alpha "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44" ++ "\x52\x00\x00\x00\x04\x00\x00\x00\x03\x08\x03\x00\x00\x00\x83" ++ "\x2a\x5e\xf4\x00\x00\x00\x12\x50\x4c\x54\x45\xff\x00\x00\x00" ++ "\xff\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x80\x80\x80\x65" ++ "\xa4\xb0\x30\x00\x00\x00\x03\x74\x52\x4e\x53\xff\x00\x80\xa9" ++ "\x56\x73\x13\x00\x00\x00\x17\x49\x44\x41\x54\x78\x9c\x63\x60" ++ "\x60\x64\x62\x66\x60\x61\x65\x60\x64\x60\x62\x66\x61\x05\x00" ++ "\x00\xc5\x00\x1f\xf6\xbe\x47\x7a\x00\x00\x00\x00\x49\x45\x4e" ++ "\x44\xae\x42\x60\x82", // 1-bit greyscale, packed 8 to a byte "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44" ++ "\x52\x00\x00\x00\x04\x00\x00\x00\x03\x01\x00\x00\x00\x00\x9c" ++ "\x8f\x93\x6b\x00\x00\x00\x0e\x49\x44\x41\x54\x78\x9c\x63\x48" ++ "\x60\x98\xc0\x60\x00\x00\x03\xc6\x01\x21\x68\xd1\x59\x51\x00" ++ "\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82", // sixteen-bit truecolour with alpha "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44" ++ "\x52\x00\x00\x00\x04\x00\x00\x00\x03\x10\x06\x00\x00\x00\xe4" ++ "\x64\x72\x85\x00\x00\x00\x3e\x49\x44\x41\x54\x78\x9c\x63\xf8" ++ "\xff\x9f\x01\x08\x40\x24\x0c\x83\x48\x04\x60\x80\x00\x18\x07" ++ "\x82\x11\x3c\x20\xc9\xc5\x25\x22\x22\x27\xf7\xff\xbf\x86\x86" ++ "\x91\x91\x8d\x4d\x43\x83\x9b\x5b\x40\x40\x54\x14\x03\xc3\x89" ++ "\x13\x97\x2e\xdd\xb9\xe3\xe0\x00\x00\x6e\x56\x33\xc7\x0a\xd4" ++ "\x42\xe1\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82", // every row filtered with paeth "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44" ++ "\x52\x00\x00\x00\x04\x00\x00\x00\x03\x08\x06\x00\x00\x00\xb4" ++ "\xf4\xae\xc6\x00\x00\x00\x2e\x49\x44\x41\x54\x78\x9c\x63\xf9" ++ "\xcf\xc0\xf0\x9f\x11\x48\x30\x00\x89\xff\x40\x9a\x85\x11\xc8" ++ "\x86\xf2\x81\x04\x50\x80\x4b\x44\x8e\x41\xd3\x58\xae\xd1\x4d" ++ "\x2e\xba\xe1\xe4\xa5\x26\x07\x00\x53\x0d\x0c\xdd\xdf\x04\xc4" ++ "\x0b\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82", // a different filter on each row, which is what a real encoder does "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44" ++ "\x52\x00\x00\x00\x04\x00\x00\x00\x03\x08\x06\x00\x00\x00\xb4" ++ "\xf4\xae\xc6\x00\x00\x00\x30\x49\x44\x41\x54\x78\x9c\x63\xf9" ++ "\xcf\xc0\xf0\x9f\x11\x48\x30\x00\x89\xff\x40\x9a\x11\xc8\xfc" ++ "\x0f\x61\x00\x05\x80\x3c\x66\x2e\x11\xb9\x86\x25\x2b\x75\x1b" ++ "\x8d\x76\xec\x75\x54\x5b\x65\x70\x10\x00\xb3\x93\x11\x62\xf9" ++ "\x24\x22\x1f\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82", // Adam7, seven passes "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44" ++ "\x52\x00\x00\x00\x04\x00\x00\x00\x03\x08\x06\x00\x00\x01\xc3" ++ "\xf3\x9e\x50\x00\x00\x00\x2f\x49\x44\x41\x54\x78\x9c\x63\xf8" ++ "\xcf\xc0\x00\x44\x0c\xff\xff\x33\x70\x89\xc8\xfd\x77\x0b\x88" ++ "\x02\x71\x80\x5c\x20\x60\xd0\x30\xb2\x69\x38\x71\xe9\x8e\x03" ++ "\x03\x58\xc1\x7f\xa8\x38\x90\x00\x00\x5c\x62\x19\xe4\x31\x59" ++ "\x85\x42\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82", // Adam7 with filters, where each pass restarts the filter state "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44" ++ "\x52\x00\x00\x00\x04\x00\x00\x00\x03\x08\x06\x00\x00\x01\xc3" ++ "\xf3\x9e\x50\x00\x00\x00\x35\x49\x44\x41\x54\x78\x9c\x63\xf9" ++ "\xcf\xc0\xf0\x9f\x09\x88\xff\x33\x72\x89\xc8\xfd\xb7\xb1\xb1" ++ "\x61\x64\x66\xf8\x0f\xe4\x36\xfc\x6f\x60\xd1\x30\xb6\x69\x3c" ++ "\xb9\xe0\xee\x01\xa0\x3c\x50\xe4\x3f\x58\x1c\x44\xfd\x07\x00" ++ "\x3f\xb1\x19\x0d\x74\x0c\x3f\x61\x00\x00\x00\x00\x49\x45\x4e" ++ "\x44\xae\x42\x60\x82", // the zlib stream split across five IDAT chunks "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44" ++ "\x52\x00\x00\x00\x04\x00\x00\x00\x03\x08\x06\x00\x00\x00\xb4" ++ "\xf4\xae\xc6\x00\x00\x00\x09\x49\x44\x41\x54\x78\x9c\x63\xf8" ++ "\xcf\xc0\xf0\x1f\x0c\xbd\xdb\x1c\x45\x00\x00\x00\x09\x49\x44" ++ "\x41\x54\x19\xfe\x83\x01\x03\x03\x98\x05\x12\x11\xcb\xd9\xb0" ++ "\x00\x00\x00\x09\x49\x44\x41\x54\x02\x53\xff\x19\xb8\x44\xe4" ++ "\xfe\x6b\x28\xf5\xf4\xb3\x00\x00\x00\x09\x49\x44\x41\x54\x18" ++ "\xd9\x34\xb8\x05\x44\x31\x9c\xb8\xe4\xbe\x1d\x41\x00\x00\x00" ++ "\x08\x49\x44\x41\x54\x74\xc7\x01\x00\xb1\x12\x19\xe4\x82\xbf" ++ "\x61\xd5\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82", // deflate with stored (uncompressed) blocks "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44" ++ "\x52\x00\x00\x00\x04\x00\x00\x00\x03\x08\x06\x00\x00\x00\xb4" ++ "\xf4\xae\xc6\x00\x00\x00\x3e\x49\x44\x41\x54\x78\x01\x01\x33" ++ "\x00\xcc\xff\x00\xff\x00\x00\xff\x00\xff\x00\xff\x00\x00\xff" ++ "\xff\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff\xff\x00\xff\x00" ++ "\xff\xff\xff\xff\x00\xff\xff\x00\x0a\x14\x1e\xff\x28\x32\x3c" ++ "\x80\x46\x50\x5a\x00\xc8\xd2\xdc\x40\xb1\x12\x19\xe4\x50\x7b" ++ "\xb9\x10\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\x82", }; /// The JPEG corpus, likewise a subset of the fixtures another implementation /// agrees about. /// /// Harder again to reach the inside of than PNG. A JPEG's entropy-coded data /// is a Huffman stream with no checksum over it, so a mutation usually decodes /// into *something* — which is the point: what these targets are looking for /// is the input that decodes into a read past the end of a plane rather than /// into a wrong-looking image. /// EXIF blocks to mutate: the two byte orders, with and without the marker /// JPEG puts in front of them, and the smallest thing that is a directory. /// Profile pieces to mutate: one whole profile in a single piece, and the /// same one cut in two. const icc_corpus = [_][]const u8{ // A piece number, a count, and a profile of 128 bytes: the size field, // then padding to the signature, then `acsp`, then the rest. "\x01\x01" ++ "\x00\x00\x00\x80" ++ (@as([32]u8, @splat('\x00'))) ++ "acsp" ++ (@as([88]u8, @splat('\x00'))), // The same profile as two pieces. "\x01\x02" ++ "\x00\x00\x00\x80" ++ (@as([32]u8, @splat('\x00'))) ++ "acsp" ++ "\x02\x02" ++ (@as([88]u8, @splat('\x00'))), // A count of zero, which nothing may be a piece of. "\x01\x00rubbish", }; const exif_corpus = [_][]const u8{ // Little-endian, orientation 6, which is the one a camera held on its side // writes and so the one that matters most. "Exif\x00\x00II\x2a\x00\x08\x00\x00\x00\x01\x00" ++ "\x12\x01\x03\x00\x01\x00\x00\x00\x06\x00\x00\x00" ++ "\x00\x00\x00\x00", // Big-endian, orientation 1, with a tag before and after it. "MM\x00\x2a\x00\x00\x00\x08\x00\x03" ++ "\x01\x0f\x00\x03\x00\x00\x00\x01\x00\x07\x00\x00" ++ "\x01\x12\x00\x03\x00\x00\x00\x01\x00\x01\x00\x00" ++ "\x01\x28\x00\x03\x00\x00\x00\x01\x00\x02\x00\x00" ++ "\x00\x00\x00\x00", // A header and an empty directory, which is the shortest well-formed block. "II\x2a\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00", // And what an APP1 holds when it is XMP instead. "http://ns.adobe.com/xap/1.0/\x00", }; /// A BMP whose "pixel data" is a whole PNG, which is `BI_PNG`. /// /// Worth a corpus entry of its own because it is the one input that sends one /// decoder into another, and because a mutation to the wrapper's header can /// disagree with the file inside it in ways nothing else here produces. const embedded_corpus = [_][]const u8{ "BM\x9a\x00\x00\x00\x00\x00\x00\x00\x36\x00\x00\x00" ++ "\x28\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00" ++ "\x05\x00\x00\x00\x64\x00\x00\x00\x13\x0b\x00\x00\x13\x0b\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x89PNG\r\n\x1a\n\x00\x00\x00\x0dIHDR" ++ "\x00\x00\x00\x02\x00\x00\x00\x02\x08\x02\x00\x00\x00\xfd\xd4\x9a\x73" ++ "\x00\x00\x00\x16IDATx\x9cc\xf8\xcf\xc0\xf0\x9f\x81\x81\x81\x01" ++ "\x00\x0e\xfe\x02\xfe\xa7\x60\x86\x35\x00\x00\x00\x00IEND\xaeB`\x82", }; /// X BitMaps to mutate: the canonical form, the X10 `short` form, one with a /// comment in it and one whose array stops early. const xbm_corpus = [_][]const u8{ "#define s_width 8\n#define s_height 2\nstatic unsigned char s_bits[] = {\n 0x3c, 0x42 };\n", "#define o_width 12\n#define o_height 1\nstatic short o_bits[] = { 0x0fff };\n", "/* a comment */\n#define c_width 4\n#define c_height 1\nstatic char c_bits[] = { -1 };\n", "#define t_width 9\n#define t_height 4\nstatic unsigned char t_bits[] = { 0xff, 0x01", }; /// X PixMaps to mutate: the canonical form, one with several keys and a /// colour name with a space in it, and one spending two characters a pixel. const xpm_corpus = [_][]const u8{ "/* XPM */\nstatic char * c[] = {\n\"3 2 2 1\",\n\" c None\",\n\". c black\",\n\".. \",\n\" ..\"\n};\n", "/* XPM */\nstatic char * m[] = {\n\"1 1 1 1\",\n\"a\ts bg\tc navy blue\tm white\",\n\"a\"\n};\n", "/* XPM */\nstatic char * w[] = {\n\"2 1 2 2\",\n\" c #010203\",\n\"zzc None\",\n\" zz\"\n};\n", }; /// GIFs to mutate: the smallest complete one, one with a transparent index /// and an extension in front of it, and one whose frame is smaller than the /// screen it sits on. const gif_corpus = [_][]const u8{ "GIF89a\x02\x00\x02\x00\x80\x00\x00\xff\x00\x00\x00\x00\xff" ++ "\x2c\x00\x00\x00\x00\x02\x00\x02\x00\x00\x02\x02\x44\x01\x00\x3b", "GIF89a\x02\x00\x01\x00\x80\x00\x00\xff\x00\x00\x00\x00\xff" ++ "\x21\xf9\x04\x01\x00\x00\x01\x00" ++ "\x2c\x00\x00\x00\x00\x02\x00\x01\x00\x00\x02\x02\x44\x01\x00\x3b", "GIF87a\x04\x00\x04\x00\x80\x00\x00\xff\x00\x00\x00\x00\xff" ++ "\x2c\x01\x00\x01\x00\x02\x00\x02\x00\x40\x02\x02\x44\x01\x00\x3b", }; /// TGAs to mutate: uncompressed, run-length encoded, and colour mapped --- /// which between them are every code path the decoder has. const tga_corpus = [_][]const u8{ "\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02\x00\x18\x00" ++ "\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\xbb\xcc", "\x00\x00\x0a\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x02\x00\x18\x00" ++ "\x83\x11\x22\x33\x81\x44\x55\x66\x83\x77\x88\x99", "\x00\x01\x01\x00\x00\x02\x00\x18\x00\x00\x00\x00\x02\x00\x02\x00\x08\x00" ++ "\xff\x00\x00\x00\x00\xff\x00\x01\x01\x00", }; /// One of each of the seven Netpbm layouts, plus a sixteen-bit one and a /// header with a comment in the middle of it --- which between them are every /// branch the header reader and the row readers have. const netpbm_corpus = [_][]const u8{ "P1\n4 2\n0 1 1 0\n1 0 0 1\n", "P2\n4 2\n255\n0 85 170 255\n255 170 85 0\n", "P3\n2 2\n255\n255 0 0 0 255 0\n0 0 255 255 255 255\n", "P4\n4 2\n\x60\x90", "P5\n4 2\n255\n\x00\x55\xaa\xff\xff\xaa\x55\x00", "P6\n2 2\n255\n\xff\x00\x00\x00\xff\x00\x00\x00\xff\xff\xff\xff", "P5\n2 1\n65535\n\x00\x00\xff\xff", "P7\nWIDTH 2\nHEIGHT 1\nDEPTH 4\nMAXVAL 255\nTUPLTYPE RGB_ALPHA\nENDHDR\n" ++ "\xff\x00\x00\x80\x00\xff\x00\xff", "P7\nWIDTH 2\nHEIGHT 1\nDEPTH 1\nMAXVAL 1\nTUPLTYPE BLACKANDWHITE\nENDHDR\n\x00\x01", "P2\n# a comment between the magic and the size\n2 1\n255\n3 200\n", }; /// An APNG, so that the `fdAT` stream and the sequence checking are reachable /// by mutation rather than only by the corpus entries that happen to be /// still images. /// /// Two frames: an `fcTL` before the `IDAT`, so the default image is frame /// zero, then one `fdAT` frame of a single pixel. const apng_corpus = [_][]const u8{ "\x89PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\x00\x00\x02\x00" ++ "\x00\x00\x02\x08\x02\x00\x00\x00\xfd\xd4\x9as\x00\x00\x00\x08" ++ "acTL\x00\x00\x00\x02\x00\x00\x00\x03j\x84\xc2\xca\x00\x00\x00" ++ "\x1afcTL\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x01\x00\x0a\x00\x00\xe8T\xdc\x00" ++ "\x00\x00\x00\x10IDATx\x9cc\xf8\xcf\xc0\x00D\x0c\x10\x0a\x00\x1f" ++ "\xee\x03\xfd\x8b_\x14\xd4\x00\x00\x00\x1afcTL\x00\x00\x00\x01" ++ "\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01" ++ "\x00\x05\x00\x00\x00\x00^\xe2-f\x00\x00\x00\x10fdAT\x00\x00\x00" ++ "\x02x\x9cc``\xf8\x0f\x00\x01\x03\x01\x00h\xbf\xed\xf4\x00\x00" ++ "\x00\x00IEND\xaeB`\x82", }; /// Icons to mutate. An entry holds either a headerless bitmap or a whole /// PNG, and the directory pointing at them is its own attack surface: /// offsets and lengths that have to be checked against a file the /// header does not describe the length of. const ico_corpus = [_][]const u8{ // four bits and an AND mask, where the mask is the only transparency "\x00\x00\x01\x00\x01\x00\x10\x10\x10\x00\x01\x00\x04\x00(\x01" ++ "\x00\x00\x16\x00\x00\x00(\x00\x00\x00\x10\x00\x00\x00 \x00\x00" ++ "\x00\x01\x00\x04\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x10\x00\x00\x00\x00" ++ "\x00\x00\x00@22\x00@QQ\x00@``\x00@>\xb7\x00@\xb7>\x00@\x92\x92" ++ "\x00@oo\x00@2\xf2\x00@\x7f\xd5\x00@\x8e\xf4\x00@\xf22\x00@\xd5" ++ "\x7f\x00@\xf4\x8e\x00@\xc7\xc7\x00@\xe3\xe3\x00\xbb\xbb\xbb" ++ "\xbc\xcd\xdd\xff\xff\xbb\xbb\xbb\xbc\xcc\xde\xff\xff\xbb\xbb" ++ "\xbb\xbc\xcc\xee\xef\xffuU[\xbb\xcc\xee\xee\xef\"wUU\xcc\xee" ++ "\xee\xef\"'wwf\xce\xee\xaa\x12\"wwvi\x99\x9a\x11\"'wwi\x99\x9a" ++ "\x11\"\"7wx\x99\x99\x11\x12\"'wt\x88\x89\x11\x11\x12\"wt\x88" ++ "\x88\x11\x11\x11\"'w\x88\x88\x01\x11\x11\x12'w\x88\x88\x00\x11" ++ "\x11\x11\"wH\x88\x00\x01\x11\x11\x12\"H\x88\x00\x00\x11\x11" ++ "\x11\"(\x88\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\xc0\x00\x00\x00\xe0" ++ "\x00\x00\x00\xf0\x00\x00\x00", // an entry that is a whole PNG "\x00\x00\x01\x00\x01\x00\x10\x10\x00\x00\x00\x00 \x00\x83\x00" ++ "\x00\x00\x16\x00\x00\x00\x89PNG\x0d\x0a\x1a\x0a\x00\x00\x00" ++ "\x0dIHDR\x00\x00\x00\x10\x00\x00\x00\x10\x08\x06\x00\x00\x00" ++ "\x1f\xf3\xffa\x00\x00\x00JIDATx\x9c\xed\x8f1\x0a\x00 \x0c\x03" ++ "O\x10t\xed\x8f\xfa\xffW\xb9\x18\xe8\xa6f\xb6\x10\x9a\xe5B\xd2" ++ " \x09\xa8\xca\x80\xb15O\xbe\x13\xd4K`l\xcd\x1b_\x03\x9eaJ\x03" ++ "\x0bV\x80\x0dk\x82\x0d\xab\x81\x0d+\xc0\x86\xff\x84?A\x7f\x01" ++ "\x16\x0b\x0a\xa2(\xd7\xa7j\x00\x00\x00\x00IEND\xaeB`\x82", // two entries, so that choosing between them is mutated too "\x00\x00\x01\x00\x02\x00\x10\x10\x00\x00\x00\x00 \x00(\x04\x00" ++ "\x00&\x00\x00\x00 \x00\x00\x00\x00 \x00(\x10\x00\x00N\x04\x00" ++ "\x00(\x00\x00\x00\x10\x00\x00\x00 \x00\x00\x00\x01\x00 \x00" ++ "\x00\x00\x00\x00\x00\x04\x00\x00\xc4\x0e\x00\x00\xc4\x0e\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00?\xfb\x05\x98@\xfa\x13\x9f" ++ "@\xf8$\xa6?\xfa5\xac@\xf9E\xb3?\xfaU\xb9?\xf9f\xc0@\xf9w\xc7" ++ "?\xfb\x87\xcd?\xfa\x97\xd4@\xfa\xa8\xda?\xfa\xb9\xe0@\xfa\xc8" ++ "\xe7@\xfa\xd9\xee?\xf9\xe9\xf5@\xfa\xfa\xfb@\xea\x05\x92?\xea" ++ "\x14\x98@\xea$\x9f@\xe94\xa6?\xeaE\xac@\xe9V\xb3?\xebf\xb9?" ++ "\xe9w\xc0@\xe9\x86\xc7?\xe9\x97\xcd?\xe9\xa7\xd4@\xe8\xb9\xdb" ++ "?\xea\xc8\xe1@\xea\xd9\xe7@\xea\xea\xee?\xea\xf9\xf5@\xda\x03" ++ "\x8bA\xda\x13\x91?\xda$\x98@\xd84\x9f@\xd9E\xa5?\xd8U\xac@\xd8" ++ "e\xb3?\xd9v\xb9?\xd9\x86\xc0@\xd9\x97\xc6?\xd9\xa7\xcd?\xd8" ++ "\xb8\xd4@\xd9\xc9\xda?\xd8\xd8\xe1@\xd9\xea\xe7@\xd9\xf9\xee" ++ "?\xc9\x03\x85@\xc9\x14\x8b@\xc8$\x92?\xc95\x98@\xc8F\x9f@\xc8" ++ "V\xa5?\xc9f\xac@\xc8v\xb3?\xc9\x87\xb9?\xc9\x97\xc0@\xc8\xa8" ++ "\xc6?\xc8\xb9\xcd?\xc7\xc8\xd4@\xc9\xd9\xda?\xc9\xe9\xe1@\xc8" ++ "\xfa\xe7@\xba\x04~?\xb8\x13\x85@\xb9$\x8b@\xb74\x92?\xb8D\x98" ++ "@\xb8V\x9f@\xb9f\xa5?\xb9v\xac@\xb7\x85\xb3?\xb8\x97\xb9?\xb8" ++ "\xa8\xc0@\xb9\xb9\xc6?\xb9\xc8\xcd?\xb8\xd9\xd4@\xb9\xe9\xda" ++ "?\xb8\xf9\xe1@\xa9\x04w@\xa7\x14~?\xa6&\x85@\xa63\x8b@\xa7D" ++ "\x92?\xa7U\x98@\xa6f\x9f@\xa8w\xa5?\xa7\x86\xac@\xa8\x98\xb3" ++ "?\xa8\xa8\xb9?\xa7\xb8\xc0@\xa7\xca\xc6?\xa7\xd9\xcd?\xa7\xe9" ++ "\xd4@\xa8\xfa\xda?\x97\x04q@\x98\x13w@\x97$~?\x975\x85@\x98" ++ "E\x8b@\x97U\x92?\x96f\x98@\x96v\x9f@\x99\x88\xa5?\x97\x97\xac" ++ "@\x97\xa8\xb3?\x97\xb8\xb9?\x97\xc8\xc0@\x97\xd9\xc6?\x97\xe8" ++ "\xce@\x98\xfb\xd3@\x87\x04k?\x86\x14p@\x87$w@\x876~?\x86E\x85" ++ "@\x87V\x8b@\x86e\x92?\x87w\x98@\x86\x86\x9f@\x86\x99\xa5?\x86" ++ "\xa7\xac@\x87\xb7\xb3?\x87\xc9\xb9?\x86\xd9\xc0@\x86\xe9\xc7" ++ "?\x87\xfb\xcd?w\x02d@u\x13j?w$q@u5w@wD~?vV\x85@wf\x8b@vv\x92" ++ "?w\x86\x98@v\x98\x9f@w\xa8\xa5?v\xb7\xac@v\xc8\xb3?v\xd9\xb9" ++ "?w\xe9\xc0@w\xf9\xc7?e\x02]@g\x12c@e&j?e3q@fFw@eW~?ee\x85@f" ++ "w\x8b@e\x86\x92?f\x98\x98@e\xa8\x9f@f\xb9\xa5?f\xc8\xac@f\xd8" ++ "\xb3?f\xeb\xb9?f\xf9\xc0@W\x05W?U\x13]?V#d@V4j?UEq@UUw@We~?" ++ "Vv\x85@V\x87\x8b@U\x97\x92?U\xa7\x98@U\xb8\x9f@V\xca\xa5?U\xd9" ++ "\xac@U\xe9\xb3@U\xfa\xb9?F\x03P@C\x11W?G#]?D3d@CCj?EXq@Ffw@" ++ "Du~?F\x86\x85@C\x98\x8b@D\xa7\x92?D\xb8\x98@D\xc8\x9f@E\xd9" ++ "\xa5?E\xe8\xad@D\xfa\xb2>4\x03I?3\x13P@4&W?44]?3Dd@4Vj?6eq@" ++ "5uw@4\x87~?5\x97\x85@3\xa8\x8b@6\xb7\x92?4\xc9\x98@4\xd8\x9f" ++ "@4\xe9\xa6?5\xfa\xac?!\x03DA%\x14J?#&P@#4W?#G]?#Td@$ej?$wq@" ++ "$\x87w@$\x97~?$\xa6\x85@$\xb9\x8b@$\xc8\x92?$\xda\x98@$\xea" ++ "\x9f@$\xfa\xa6?\x19\x00\x14=\x13\x13B>\x14%J?\x133PA\x11DV?" ++ "\x13U]?\x11fd@\x13xj?\x14\x88p@\x13\x98w@\x14\xa7~?\x13\xb8" ++ "\x85@\x14\xc9\x8bA\x13\xda\x91?\x14\xea\x98@\x13\xfa\x9f\x00" ++ "\x00\x00\x00C\x00\x1a\x13C\x03%D>\x034I?\x03FPA\x05XV?\x05e" ++ "]?\x02ud@\x02\x87k?\x04\x97q@\x04\xa9w@\x04\xba~?\x03\xc9\x85" ++ "?\x03\xd8\x8c@\x05\xe8\x93?\x05\xf9\x98(\x00\x00\x00 \x00\x00" ++ "\x00@\x00\x00\x00\x01\x00 \x00\x00\x00\x00\x00\x00\x10\x00\x00" ++ "\xc4\x0e\x00\x00\xc4\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00@\xff\x00\x98@\xff\x08\x9c@\xff\x10\x9f@\xff\x18\xa2@\xff" ++ " \xa6@\xff)\xa9@\xff1\xac@\xff9\xaf@\xffA\xb3@\xffJ\xb6@\xff" ++ "R\xb9@\xffZ\xbd@\xffb\xc0@\xffj\xc3@\xffs\xc7@\xff{\xca@\xff" ++ "\x83\xcd@\xff\x8b\xd0@\xff\x94\xd4@\xff\x9c\xd7@\xff\xa4\xda" ++ "@\xff\xac\xde@\xff\xb4\xe1@\xff\xbd\xe4@\xff\xc5\xe7@\xff\xcd" ++ "\xeb@\xff\xd5\xee@\xff\xde\xf1@\xff\xe6\xf5@\xff\xee\xf8@\xff" ++ "\xf6\xfb@\xff\xff\xff@\xf6\x00\x95@\xf6\x08\x98@\xf6\x10\x9c" ++ "@\xf6\x18\x9f@\xf6 \xa2@\xf6)\xa6@\xf61\xa9@\xf69\xac@\xf6A" ++ "\xaf@\xf6J\xb3@\xf6R\xb6@\xf6Z\xb9@\xf6b\xbd@\xf6j\xc0@\xf6" ++ "s\xc3@\xf6{\xc7@\xf6\x83\xca@\xf6\x8b\xcd@\xf6\x94\xd0@\xf6" ++ "\x9c\xd4@\xf6\xa4\xd7@\xf6\xac\xda@\xf6\xb4\xde@\xf6\xbd\xe1" ++ "@\xf6\xc5\xe4@\xf6\xcd\xe7@\xf6\xd5\xeb@\xf6\xde\xee@\xf6\xe6" ++ "\xf1@\xf6\xee\xf5@\xf6\xf6\xf8@\xf6\xff\xfb@\xee\x00\x92@\xee" ++ "\x08\x95@\xee\x10\x98@\xee\x18\x9c@\xee \x9f@\xee)\xa2@\xee" ++ "1\xa6@\xee9\xa9@\xeeA\xac@\xeeJ\xaf@\xeeR\xb3@\xeeZ\xb6@\xee" ++ "b\xb9@\xeej\xbd@\xees\xc0@\xee{\xc3@\xee\x83\xc7@\xee\x8b\xca" ++ "@\xee\x94\xcd@\xee\x9c\xd0@\xee\xa4\xd4@\xee\xac\xd7@\xee\xb4" ++ "\xda@\xee\xbd\xde@\xee\xc5\xe1@\xee\xcd\xe4@\xee\xd5\xe7@\xee" ++ "\xde\xeb@\xee\xe6\xee@\xee\xee\xf1@\xee\xf6\xf5@\xee\xff\xf8" ++ "@\xe6\x00\x8f@\xe6\x08\x92@\xe6\x10\x95@\xe6\x18\x98@\xe6 \x9c" ++ "@\xe6)\x9f@\xe61\xa2@\xe69\xa6@\xe6A\xa9@\xe6J\xac@\xe6R\xaf" ++ "@\xe6Z\xb3@\xe6b\xb6@\xe6j\xb9@\xe6s\xbd@\xe6{\xc0@\xe6\x83" ++ "\xc3@\xe6\x8b\xc7@\xe6\x94\xca@\xe6\x9c\xcd@\xe6\xa4\xd0@\xe6" ++ "\xac\xd4@\xe6\xb4\xd7@\xe6\xbd\xda@\xe6\xc5\xde@\xe6\xcd\xe1" ++ "@\xe6\xd5\xe4@\xe6\xde\xe7@\xe6\xe6\xeb@\xe6\xee\xee@\xe6\xf6" ++ "\xf1@\xe6\xff\xf5@\xde\x00\x8b@\xde\x08\x8f@\xde\x10\x92@\xde" ++ "\x18\x95@\xde \x98@\xde)\x9c@\xde1\x9f@\xde9\xa2@\xdeA\xa6@" ++ "\xdeJ\xa9@\xdeR\xac@\xdeZ\xaf@\xdeb\xb3@\xdej\xb6@\xdes\xb9" ++ "@\xde{\xbd@\xde\x83\xc0@\xde\x8b\xc3@\xde\x94\xc7@\xde\x9c\xca" ++ "@\xde\xa4\xcd@\xde\xac\xd0@\xde\xb4\xd4@\xde\xbd\xd7@\xde\xc5" ++ "\xda@\xde\xcd\xde@\xde\xd5\xe1@\xde\xde\xe4@\xde\xe6\xe7@\xde" ++ "\xee\xeb@\xde\xf6\xee@\xde\xff\xf1@\xd5\x00\x88@\xd5\x08\x8b" ++ "@\xd5\x10\x8f@\xd5\x18\x92@\xd5 \x95@\xd5)\x98@\xd51\x9c@\xd5" ++ "9\x9f@\xd5A\xa2@\xd5J\xa6@\xd5R\xa9@\xd5Z\xac@\xd5b\xaf@\xd5" ++ "j\xb3@\xd5s\xb6@\xd5{\xb9@\xd5\x83\xbd@\xd5\x8b\xc0@\xd5\x94" ++ "\xc3@\xd5\x9c\xc7@\xd5\xa4\xca@\xd5\xac\xcd@\xd5\xb4\xd0@\xd5" ++ "\xbd\xd4@\xd5\xc5\xd7@\xd5\xcd\xda@\xd5\xd5\xde@\xd5\xde\xe1" ++ "@\xd5\xe6\xe4@\xd5\xee\xe7@\xd5\xf6\xeb@\xd5\xff\xee@\xcd\x00" ++ "\x85@\xcd\x08\x88@\xcd\x10\x8b@\xcd\x18\x8f@\xcd \x92@\xcd)" ++ "\x95@\xcd1\x98@\xcd9\x9c@\xcdA\x9f@\xcdJ\xa2@\xcdR\xa6@\xcd" ++ "Z\xa9@\xcdb\xac@\xcdj\xaf@\xcds\xb3@\xcd{\xb6@\xcd\x83\xb9@" ++ "\xcd\x8b\xbd@\xcd\x94\xc0@\xcd\x9c\xc3@\xcd\xa4\xc7@\xcd\xac" ++ "\xca@\xcd\xb4\xcd@\xcd\xbd\xd0@\xcd\xc5\xd4@\xcd\xcd\xd7@\xcd" ++ "\xd5\xda@\xcd\xde\xde@\xcd\xe6\xe1@\xcd\xee\xe4@\xcd\xf6\xe7" ++ "@\xcd\xff\xeb@\xc5\x00\x81@\xc5\x08\x85@\xc5\x10\x88@\xc5\x18" ++ "\x8b@\xc5 \x8f@\xc5)\x92@\xc51\x95@\xc59\x98@\xc5A\x9c@\xc5" ++ "J\x9f@\xc5R\xa2@\xc5Z\xa6@\xc5b\xa9@\xc5j\xac@\xc5s\xaf@\xc5" ++ "{\xb3@\xc5\x83\xb6@\xc5\x8b\xb9@\xc5\x94\xbd@\xc5\x9c\xc0@\xc5" ++ "\xa4\xc3@\xc5\xac\xc7@\xc5\xb4\xca@\xc5\xbd\xcd@\xc5\xc5\xd0" ++ "@\xc5\xcd\xd4@\xc5\xd5\xd7@\xc5\xde\xda@\xc5\xe6\xde@\xc5\xee" ++ "\xe1@\xc5\xf6\xe4@\xc5\xff\xe7@\xbd\x00~@\xbd\x08\x81@\xbd\x10" ++ "\x85@\xbd\x18\x88@\xbd \x8b@\xbd)\x8f@\xbd1\x92@\xbd9\x95@\xbd" ++ "A\x98@\xbdJ\x9c@\xbdR\x9f@\xbdZ\xa2@\xbdb\xa6@\xbdj\xa9@\xbd" ++ "s\xac@\xbd{\xaf@\xbd\x83\xb3@\xbd\x8b\xb6@\xbd\x94\xb9@\xbd" ++ "\x9c\xbd@\xbd\xa4\xc0@\xbd\xac\xc3@\xbd\xb4\xc7@\xbd\xbd\xca" ++ "@\xbd\xc5\xcd@\xbd\xcd\xd0@\xbd\xd5\xd4@\xbd\xde\xd7@\xbd\xe6" ++ "\xda@\xbd\xee\xde@\xbd\xf6\xe1@\xbd\xff\xe4@\xb4\x00{@\xb4\x08" ++ "~@\xb4\x10\x81@\xb4\x18\x85@\xb4 \x88@\xb4)\x8b@\xb41\x8f@\xb4" ++ "9\x92@\xb4A\x95@\xb4J\x98@\xb4R\x9c@\xb4Z\x9f@\xb4b\xa2@\xb4" ++ "j\xa6@\xb4s\xa9@\xb4{\xac@\xb4\x83\xaf@\xb4\x8b\xb3@\xb4\x94" ++ "\xb6@\xb4\x9c\xb9@\xb4\xa4\xbd@\xb4\xac\xc0@\xb4\xb4\xc3@\xb4" ++ "\xbd\xc7@\xb4\xc5\xca@\xb4\xcd\xcd@\xb4\xd5\xd0@\xb4\xde\xd4" ++ "@\xb4\xe6\xd7@\xb4\xee\xda@\xb4\xf6\xde@\xb4\xff\xe1@\xac\x00" ++ "w@\xac\x08{@\xac\x10~@\xac\x18\x81@\xac \x85@\xac)\x88@\xac" ++ "1\x8b@\xac9\x8f@\xacA\x92@\xacJ\x95@\xacR\x98@\xacZ\x9c@\xac" ++ "b\x9f@\xacj\xa2@\xacs\xa6@\xac{\xa9@\xac\x83\xac@\xac\x8b\xaf" ++ "@\xac\x94\xb3@\xac\x9c\xb6@\xac\xa4\xb9@\xac\xac\xbd@\xac\xb4" ++ "\xc0@\xac\xbd\xc3@\xac\xc5\xc7@\xac\xcd\xca@\xac\xd5\xcd@\xac" ++ "\xde\xd0@\xac\xe6\xd4@\xac\xee\xd7@\xac\xf6\xda@\xac\xff\xde" ++ "@\xa4\x00t@\xa4\x08w@\xa4\x10{@\xa4\x18~@\xa4 \x81@\xa4)\x85" ++ "@\xa41\x88@\xa49\x8b@\xa4A\x8f@\xa4J\x92@\xa4R\x95@\xa4Z\x98" ++ "@\xa4b\x9c@\xa4j\x9f@\xa4s\xa2@\xa4{\xa6@\xa4\x83\xa9@\xa4\x8b" ++ "\xac@\xa4\x94\xaf@\xa4\x9c\xb3@\xa4\xa4\xb6@\xa4\xac\xb9@\xa4" ++ "\xb4\xbd@\xa4\xbd\xc0@\xa4\xc5\xc3@\xa4\xcd\xc7@\xa4\xd5\xca" ++ "@\xa4\xde\xcd@\xa4\xe6\xd0@\xa4\xee\xd4@\xa4\xf6\xd7@\xa4\xff" ++ "\xda@\x9c\x00q@\x9c\x08t@\x9c\x10w@\x9c\x18{@\x9c ~@\x9c)\x81" ++ "@\x9c1\x85@\x9c9\x88@\x9cA\x8b@\x9cJ\x8f@\x9cR\x92@\x9cZ\x95" ++ "@\x9cb\x98@\x9cj\x9c@\x9cs\x9f@\x9c{\xa2@\x9c\x83\xa6@\x9c\x8b" ++ "\xa9@\x9c\x94\xac@\x9c\x9c\xaf@\x9c\xa4\xb3@\x9c\xac\xb6@\x9c" ++ "\xb4\xb9@\x9c\xbd\xbd@\x9c\xc5\xc0@\x9c\xcd\xc3@\x9c\xd5\xc7" ++ "@\x9c\xde\xca@\x9c\xe6\xcd@\x9c\xee\xd0@\x9c\xf6\xd4@\x9c\xff" ++ "\xd7@\x94\x00n@\x94\x08q@\x94\x10t@\x94\x18w@\x94 {@\x94)~@" ++ "\x941\x81@\x949\x85@\x94A\x88@\x94J\x8b@\x94R\x8f@\x94Z\x92" ++ "@\x94b\x95@\x94j\x98@\x94s\x9c@\x94{\x9f@\x94\x83\xa2@\x94\x8b" ++ "\xa6@\x94\x94\xa9@\x94\x9c\xac@\x94\xa4\xaf@\x94\xac\xb3@\x94" ++ "\xb4\xb6@\x94\xbd\xb9@\x94\xc5\xbd@\x94\xcd\xc0@\x94\xd5\xc3" ++ "@\x94\xde\xc7@\x94\xe6\xca@\x94\xee\xcd@\x94\xf6\xd0@\x94\xff" ++ "\xd4@\x8b\x00j@\x8b\x08n@\x8b\x10q@\x8b\x18t@\x8b w@\x8b){@" ++ "\x8b1~@\x8b9\x81@\x8bA\x85@\x8bJ\x88@\x8bR\x8b@\x8bZ\x8f@\x8b" ++ "b\x92@\x8bj\x95@\x8bs\x98@\x8b{\x9c@\x8b\x83\x9f@\x8b\x8b\xa2" ++ "@\x8b\x94\xa6@\x8b\x9c\xa9@\x8b\xa4\xac@\x8b\xac\xaf@\x8b\xb4" ++ "\xb3@\x8b\xbd\xb6@\x8b\xc5\xb9@\x8b\xcd\xbd@\x8b\xd5\xc0@\x8b" ++ "\xde\xc3@\x8b\xe6\xc7@\x8b\xee\xca@\x8b\xf6\xcd@\x8b\xff\xd0" ++ "@\x83\x00g@\x83\x08j@\x83\x10n@\x83\x18q@\x83 t@\x83)w@\x83" ++ "1{@\x839~@\x83A\x81@\x83J\x85@\x83R\x88@\x83Z\x8b@\x83b\x8f" ++ "@\x83j\x92@\x83s\x95@\x83{\x98@\x83\x83\x9c@\x83\x8b\x9f@\x83" ++ "\x94\xa2@\x83\x9c\xa6@\x83\xa4\xa9@\x83\xac\xac@\x83\xb4\xaf" ++ "@\x83\xbd\xb3@\x83\xc5\xb6@\x83\xcd\xb9@\x83\xd5\xbd@\x83\xde" ++ "\xc0@\x83\xe6\xc3@\x83\xee\xc7@\x83\xf6\xca@\x83\xff\xcd@{\x00" ++ "d@{\x08g@{\x10j@{\x18n@{ q@{)t@{1w@{9{@{A~@{J\x81@{R\x85@{Z" ++ "\x88@{b\x8b@{j\x8f@{s\x92@{{\x95@{\x83\x98@{\x8b\x9c@{\x94\x9f" ++ "@{\x9c\xa2@{\xa4\xa6@{\xac\xa9@{\xb4\xac@{\xbd\xaf@{\xc5\xb3" ++ "@{\xcd\xb6@{\xd5\xb9@{\xde\xbd@{\xe6\xc0@{\xee\xc3@{\xf6\xc7" ++ "@{\xff\xca@s\x00`@s\x08d@s\x10g@s\x18j@s n@s)q@s1t@s9w@sA{@" ++ "sJ~@sR\x81@sZ\x85@sb\x88@sj\x8b@ss\x8f@s{\x92@s\x83\x95@s\x8b" ++ "\x98@s\x94\x9c@s\x9c\x9f@s\xa4\xa2@s\xac\xa6@s\xb4\xa9@s\xbd" ++ "\xac@s\xc5\xaf@s\xcd\xb3@s\xd5\xb6@s\xde\xb9@s\xe6\xbd@s\xee" ++ "\xc0@s\xf6\xc3@s\xff\xc7@j\x00]@j\x08`@j\x10d@j\x18g@j j@j)" ++ "n@j1q@j9t@jAw@jJ{@jR~@jZ\x81@jb\x85@jj\x88@js\x8b@j{\x8f@j\x83" ++ "\x92@j\x8b\x95@j\x94\x98@j\x9c\x9c@j\xa4\x9f@j\xac\xa2@j\xb4" ++ "\xa6@j\xbd\xa9@j\xc5\xac@j\xcd\xaf@j\xd5\xb3@j\xde\xb6@j\xe6" ++ "\xb9@j\xee\xbd@j\xf6\xc0@j\xff\xc3@b\x00Z@b\x08]@b\x10`@b\x18" ++ "d@b g@b)j@b1n@b9q@bAt@bJw@bR{@bZ~@bb\x81@bj\x85@bs\x88@b{\x8b" ++ "@b\x83\x8f@b\x8b\x92@b\x94\x95@b\x9c\x98@b\xa4\x9c@b\xac\x9f" ++ "@b\xb4\xa2@b\xbd\xa6@b\xc5\xa9@b\xcd\xac@b\xd5\xaf@b\xde\xb3" ++ "@b\xe6\xb6@b\xee\xb9@b\xf6\xbd@b\xff\xc0@Z\x00W@Z\x08Z@Z\x10" ++ "]@Z\x18`@Z d@Z)g@Z1j@Z9n@ZAq@ZJt@ZRw@ZZ{@Zb~@Zj\x81@Zs\x85@" ++ "Z{\x88@Z\x83\x8b@Z\x8b\x8f@Z\x94\x92@Z\x9c\x95@Z\xa4\x98@Z\xac" ++ "\x9c@Z\xb4\x9f@Z\xbd\xa2@Z\xc5\xa6@Z\xcd\xa9@Z\xd5\xac@Z\xde" ++ "\xaf@Z\xe6\xb3@Z\xee\xb6@Z\xf6\xb9@Z\xff\xbd@R\x00S@R\x08W@" ++ "R\x10Z@R\x18]@R `@R)d@R1g@R9j@RAn@RJq@RRt@RZw@Rb{@Rj~@Rs\x81" ++ "@R{\x85@R\x83\x88@R\x8b\x8b@R\x94\x8f@R\x9c\x92@R\xa4\x95@R" ++ "\xac\x98@R\xb4\x9c@R\xbd\x9f@R\xc5\xa2@R\xcd\xa6@R\xd5\xa9@" ++ "R\xde\xac@R\xe6\xaf@R\xee\xb3@R\xf6\xb6@R\xff\xb9@J\x00P@J\x08" ++ "S@J\x10W@J\x18Z@J ]@J)`@J1d@J9g@JAj@JJn@JRq@JZt@Jbw@Jj{@Js~" ++ "@J{\x81@J\x83\x85@J\x8b\x88@J\x94\x8b@J\x9c\x8f@J\xa4\x92@J" ++ "\xac\x95@J\xb4\x98@J\xbd\x9c@J\xc5\x9f@J\xcd\xa2@J\xd5\xa6@" ++ "J\xde\xa9@J\xe6\xac@J\xee\xaf@J\xf6\xb3@J\xff\xb6@A\x00M@A\x08" ++ "P@A\x10S@A\x18W@A Z@A)]@A1`@A9d@AAg@AJj@ARn@AZq@Abt@Ajw@As{" ++ "@A{~@A\x83\x81@A\x8b\x85@A\x94\x88@A\x9c\x8b@A\xa4\x8f@A\xac" ++ "\x92@A\xb4\x95@A\xbd\x98@A\xc5\x9c@A\xcd\x9f@A\xd5\xa2@A\xde" ++ "\xa6@A\xe6\xa9@A\xee\xac@A\xf6\xaf@A\xff\xb3@9\x00I@9\x08M@" ++ "9\x10P@9\x18S@9 W@9)Z@91]@99`@9Ad@9Jg@9Rj@9Zn@9bq@9jt@9sw@9" ++ "{{@9\x83~@9\x8b\x81@9\x94\x85@9\x9c\x88@9\xa4\x8b@9\xac\x8f" ++ "@9\xb4\x92@9\xbd\x95@9\xc5\x98@9\xcd\x9c@9\xd5\x9f@9\xde\xa2" ++ "@9\xe6\xa6@9\xee\xa9@9\xf6\xac@9\xff\xaf@1\x00F@1\x08I@1\x10" ++ "M@1\x18P@1 S@1)W@11Z@19]@1A`@1Jd@1Rg@1Zj@1bn@1jq@1st@1{w@1\x83" ++ "{@1\x8b~@1\x94\x81@1\x9c\x85@1\xa4\x88@1\xac\x8b@1\xb4\x8f@" ++ "1\xbd\x92@1\xc5\x95@1\xcd\x98@1\xd5\x9c@1\xde\x9f@1\xe6\xa2" ++ "@1\xee\xa6@1\xf6\xa9@1\xff\xac@)\x00C@)\x08F@)\x10I@)\x18M@" ++ ") P@))S@)1W@)9Z@)A]@)J`@)Rd@)Zg@)bj@)jn@)sq@){t@)\x83w@)\x8b" ++ "{@)\x94~@)\x9c\x81@)\xa4\x85@)\xac\x88@)\xb4\x8b@)\xbd\x8f@" ++ ")\xc5\x92@)\xcd\x95@)\xd5\x98@)\xde\x9c@)\xe6\x9f@)\xee\xa2" ++ "@)\xf6\xa6@)\xff\xa9@ \x00@@ \x08C@ \x10F@ \x18I@ M@ )P@ 1" ++ "S@ 9W@ AZ@ J]@ R`@ Zd@ bg@ jj@ sn@ {q@ \x83t@ \x8bw@ \x94{@" ++ " \x9c~@ \xa4\x81@ \xac\x85@ \xb4\x88@ \xbd\x8b@ \xc5\x8f@ \xcd" ++ "\x92@ \xd5\x95@ \xde\x98@ \xe6\x9c@ \xee\x9f@ \xf6\xa2@ \xff" ++ "\xa6@\x18\x00\x00@\x18\x08@@\x18\x10C@\x18\x18F@\x18 I@\x18" ++ ")M@\x181P@\x189S@\x18AW@\x18JZ@\x18R]@\x18Z`@\x18bd@\x18jg@" ++ "\x18sj@\x18{n@\x18\x83q@\x18\x8bt@\x18\x94w@\x18\x9c{@\x18\xa4" ++ "~@\x18\xac\x81@\x18\xb4\x85@\x18\xbd\x88@\x18\xc5\x8b@\x18\xcd" ++ "\x8f@\x18\xd5\x92@\x18\xde\x95@\x18\xe6\x98@\x18\xee\x9c@\x18" ++ "\xf6\x9f@\x18\xff\xa2@\x10\x00\x00@\x10\x08\x00@\x10\x10@@\x10" ++ "\x18C@\x10 F@\x10)I@\x101M@\x109P@\x10AS@\x10JW@\x10RZ@\x10" ++ "Z]@\x10b`@\x10jd@\x10sg@\x10{j@\x10\x83n@\x10\x8bq@\x10\x94" ++ "t@\x10\x9cw@\x10\xa4{@\x10\xac~@\x10\xb4\x81@\x10\xbd\x85@\x10" ++ "\xc5\x88@\x10\xcd\x8b@\x10\xd5\x8f@\x10\xde\x92@\x10\xe6\x95" ++ "@\x10\xee\x98@\x10\xf6\x9c@\x10\xff\x9f@\x08\x00\x00@\x08\x08" ++ "\x00@\x08\x10\x00@\x08\x18@@\x08 C@\x08)F@\x081I@\x089M@\x08" ++ "AP@\x08JS@\x08RW@\x08ZZ@\x08b]@\x08j`@\x08sd@\x08{g@\x08\x83" ++ "j@\x08\x8bn@\x08\x94q@\x08\x9ct@\x08\xa4w@\x08\xac{@\x08\xb4" ++ "~@\x08\xbd\x81@\x08\xc5\x85@\x08\xcd\x88@\x08\xd5\x8b@\x08\xde" ++ "\x8f@\x08\xe6\x92@\x08\xee\x95@\x08\xf6\x98@\x08\xff\x9c@\x00" ++ "\x00\x00@\x00\x08\x00@\x00\x10\x00@\x00\x18\x00@\x00 @@\x00" ++ ")C@\x001F@\x009I@\x00AM@\x00JP@\x00RS@\x00ZW@\x00bZ@\x00j]@" ++ "\x00s`@\x00{d@\x00\x83g@\x00\x8bj@\x00\x94n@\x00\x9cq@\x00\xa4" ++ "t@\x00\xacw@\x00\xb4{@\x00\xbd~@\x00\xc5\x81@\x00\xcd\x85@\x00" ++ "\xd5\x88@\x00\xde\x8b@\x00\xe6\x8f@\x00\xee\x92@\x00\xf6\x95" ++ "@\x00\xff\x98", }; /// PCXs to mutate: the shapes whose pixel extraction differs, since that is /// where a header field and a row of bytes can be made to disagree. const pcx_corpus = [_][]const u8{ // one bit in each of four planes, which is the shape a mutation is most likely to desynchronise "\x0a\x05\x01\x01\x00\x00\x00\x00\x06\x00\x04\x00d\x00d\x00\x12" ++ "\x1a\x02Z\x1a\x09\x12f\x07Zf#\xa2\x1a\x10\xec\x1a\x15\xb4fF" ++ "\x12\x99\x0bZ\x995H\xcc8\xa2\x99_\xb4\xb3w\x00\x00\xff\xff\xff" ++ "\xff\xb4\xcc\x8c\x00\x00\x00\x00\x04\x01\x00\x01\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x002\x00\x0e\x022\x00" ++ "\x0e\x000\xc1\xfe\x0e\x00\xc1\xc2\xc1\xce\xc1\xc0>\xc1\xf8\x0c" ++ "\x86~\x0c\x12\x1a\x02Z\x1a\x09\x12f\x07Zf#\xa2\x1a\x10\xec\x1a" ++ "\x15\xb4fF\x12\x99\x0bZ\x995H\xcc8\xa2\x99_\xb4\xb3w\x00\x00" ++ "\xff\xff\xff\xff\xb4\xcc\x8c\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", // four bits packed two to a byte "\x0a\x05\x01\x04\x00\x00\x00\x00\x06\x00\x04\x00H\x00H\x00\x00" ++ "\x00\x00\x11\x11\x11\"\"\"333DDDUUUfffwww\x88\x88\x88\x99\x99" ++ "\x99\xaa\xaa\xaa\xbb\xbb\xbb\xcc\xcc\xcc\xdd\xdd\xdd\xee\xee" ++ "\xee\xff\xff\xff\x00\x01\x04\x00\x01\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x02F\x9b\xc1\xd0\x02F\x9b\xc1" ++ "\xd0\x02F\x9b\xc1\xd0\x02F\x9b\xc1\xd0\x02F\x9b\xc1\xd0", // one bit in one plane, whose palette says nothing "\x0a\x02\x01\x01\x00\x00\x00\x00\x06\x00\x04\x00d\x00d\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff" ++ "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" ++ "\xff\xff\x00\x01\x02\x00\x01\x00\x07\x00\x05\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x02\x00\x14\x00J\x00*\x00t\x00", // eight bits in three planes "\x0a\x05\x01\x08\x00\x00\x00\x00\x06\x00\x04\x00d\x00d\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff\xff\xff" ++ "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff" ++ "\xff\xff\x00\x03\x08\x00\x01\x00\x07\x00\x05\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00$Hl\x90\xb4\xc1\xff\x00\xc6\x00" ++ "\xc1\xff\x00\xc6\x00\xc1\xff\x00\x00$Hl\x90\xb4\xc1\xd8\x00" ++ "\xc73\x00\x00\x07\x0e\x15\x1c#*\x00\x00$Hl\x90\xb4\xc1\xd8\x00" ++ "\xc7f\x00\x00\x0e\x1c*8FT\x00\x00$Hl\x90\xb4\xc1\xd8\x00\xc7" ++ "\x99\x00\x00\x15*?Ti~\x00\xc1\xff$Hl\x90\xb4\x00\x00\x00\xc5" ++ "\xcc\x00\x00\x00\x1c8Tp\x8c\xc1\xff\x00", }; const jpeg_corpus = [_][]const u8{ // four components, Adobe CMYK, which is stored inverted "\xff\xd8\xff\xee\x00\x0e\x41\x64\x6f\x62\x65\x00\x64\x00\x00" ++ "\x00\x00\x00\xff\xdb\x00\x43\x00\x03\x02\x02\x03\x02\x02\x03" ++ "\x03\x03\x03\x04\x03\x03\x04\x05\x08\x05\x05\x04\x04\x05\x0a" ++ "\x07\x07\x06\x08\x0c\x0a\x0c\x0c\x0b\x0a\x0b\x0b\x0d\x0e\x12" ++ "\x10\x0d\x0e\x11\x0e\x0b\x0b\x10\x16\x10\x11\x13\x14\x15\x15" ++ "\x15\x0c\x0f\x17\x18\x16\x14\x18\x12\x14\x15\x14\xff\xc0\x00" ++ "\x14\x08\x00\x10\x00\x18\x04\x43\x11\x00\x4d\x11\x00\x59\x11" ++ "\x00\x4b\x11\x00\xff\xc4\x00\x1f\x00\x00\x01\x05\x01\x01\x01" ++ "\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x01\x02\x03\x04" ++ "\x05\x06\x07\x08\x09\x0a\x0b\xff\xc4\x00\xb5\x10\x00\x02\x01" ++ "\x03\x03\x02\x04\x03\x05\x05\x04\x04\x00\x00\x01\x7d\x01\x02" ++ "\x03\x00\x04\x11\x05\x12\x21\x31\x41\x06\x13\x51\x61\x07\x22" ++ "\x71\x14\x32\x81\x91\xa1\x08\x23\x42\xb1\xc1\x15\x52\xd1\xf0" ++ "\x24\x33\x62\x72\x82\x09\x0a\x16\x17\x18\x19\x1a\x25\x26\x27" ++ "\x28\x29\x2a\x34\x35\x36\x37\x38\x39\x3a\x43\x44\x45\x46\x47" ++ "\x48\x49\x4a\x53\x54\x55\x56\x57\x58\x59\x5a\x63\x64\x65\x66" ++ "\x67\x68\x69\x6a\x73\x74\x75\x76\x77\x78\x79\x7a\x83\x84\x85" ++ "\x86\x87\x88\x89\x8a\x92\x93\x94\x95\x96\x97\x98\x99\x9a\xa2" ++ "\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xb2\xb3\xb4\xb5\xb6\xb7\xb8" ++ "\xb9\xba\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xd2\xd3\xd4\xd5" ++ "\xd6\xd7\xd8\xd9\xda\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea" ++ "\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xff\xda\x00\x0e\x04" ++ "\x43\x00\x4d\x00\x59\x00\x4b\x00\x00\x3f\x00\xfa\xf7\xf6\x92" ++ "\xff\x00\x97\xaf\xc6\xba\x8f\xf8\x79\x27\xfd\x45\x3f\xf2\x25" ++ "\x7b\x9f\xc6\xdf\x8d\xbf\xf1\xf1\xfe\x91\xeb\xde\xbf\x44\x7e" ++ "\x20\x7f\xcb\x4f\xc6\xbf\x2a\xbf\x69\x2f\xf9\x7a\xfc\x68\xff" ++ "\x00\x87\x92\x7f\xd4\x53\xff\x00\x22\x57\xc1\x3f\x15\xfe\x2b" ++ "\xdf\x6b\xfa\xac\x5a\x66\x99\x15\xc6\xa3\xa9\x5e\xcc\xb6\xd6" ++ "\xb6\x76\x91\xb4\xb3\x4f\x2b\xb0\x54\x8d\x11\x41\x2c\xcc\xc4" ++ "\x00\xa0\x12\x49\x00\x57\xcd\x5f\x10\x3f\xe5\xa7\xe3\x5f\xaa" ++ "\xbf\xb4\x97\xfc\xbd\x7e\x34\x7f\xc3\xc9\x3f\xea\x29\xff\x00" ++ "\x91\x2b\xec\x0f\xd9\x7f\xf6\x5f\xb1\xfd\x99\xf4\xaf\xf8\x4e" ++ "\x3c\x71\xf6\x7d\x47\xe2\xad\xec\x2c\x11\x03\xac\xb0\xe8\x31" ++ "\x3a\x90\xd0\xc2\xc3\x21\xa7\x65\x25\x64\x98\x64\x60\x98\xe3" ++ "\x3b\x37\xbc\xdf\x35\x7c\x40\xff\x00\x96\x9f\x8d\x1f\xb4\x97" ++ "\xfc\xbd\x7e\x34\x7f\xc3\xc9\x3f\xea\x29\xff\x00\x91\x2b\xe3" ++ "\xff\x00\x8a\xff\x00\x15\xef\xb5\xfd\x56\x2d\x33\x4c\x8a\xe3" ++ "\x51\xd4\xaf\x66\x5b\x6b\x5b\x3b\x48\xda\x59\xa7\x95\xd8\x2a" ++ "\x46\x88\xa0\x96\x66\x62\x00\x50\x09\x24\x80\x2b\xf4\xab\xe2" ++ "\x07\xfc\xb4\xfc\x6b\xf2\xab\xf6\x92\xff\x00\x97\xaf\xc6\x8f" ++ "\xf8\x79\x27\xfd\x45\x3f\xf2\x25\x7d\x81\xfb\x2f\xfe\xcb\xf6" ++ "\x3f\xb3\x3e\x95\xff\x00\x09\xc7\x8e\x3e\xcf\xa8\xfc\x55\xbd" ++ "\x85\x82\x20\x75\x96\x1d\x06\x27\x52\x1a\x18\x58\x64\x34\xec" ++ "\xa4\xac\x93\x0c\x8c\x13\x1c\x67\x66\xf7\x9b\xe6\xaf\x88\x1f" ++ "\xf2\xd3\xf1\xaf\xd5\x5f\xda\x4b\xfe\x5e\xbf\x1a\x3f\xe1\xe4" ++ "\x9f\xf5\x14\xff\x00\xc8\x95\xcf\xfc\x6d\xf8\xdb\xff\x00\x1f" ++ "\x1f\xe9\x1e\xbd\xeb\xe6\xaf\x88\x1f\xf2\xd3\xf1\xaf\xff\xd9", // four components, Adobe YCCK: YCbCr and a black channel "\xff\xd8\xff\xee\x00\x0e\x41\x64\x6f\x62\x65\x00\x64\x00\x00" ++ "\x00\x00\x02\xff\xdb\x00\x43\x00\x03\x02\x02\x03\x02\x02\x03" ++ "\x03\x03\x03\x04\x03\x03\x04\x05\x08\x05\x05\x04\x04\x05\x0a" ++ "\x07\x07\x06\x08\x0c\x0a\x0c\x0c\x0b\x0a\x0b\x0b\x0d\x0e\x12" ++ "\x10\x0d\x0e\x11\x0e\x0b\x0b\x10\x16\x10\x11\x13\x14\x15\x15" ++ "\x15\x0c\x0f\x17\x18\x16\x14\x18\x12\x14\x15\x14\xff\xc0\x00" ++ "\x14\x08\x00\x10\x00\x18\x04\x43\x11\x00\x4d\x11\x00\x59\x11" ++ "\x00\x4b\x11\x00\xff\xc4\x00\x1f\x00\x00\x01\x05\x01\x01\x01" ++ "\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x01\x02\x03\x04" ++ "\x05\x06\x07\x08\x09\x0a\x0b\xff\xc4\x00\xb5\x10\x00\x02\x01" ++ "\x03\x03\x02\x04\x03\x05\x05\x04\x04\x00\x00\x01\x7d\x01\x02" ++ "\x03\x00\x04\x11\x05\x12\x21\x31\x41\x06\x13\x51\x61\x07\x22" ++ "\x71\x14\x32\x81\x91\xa1\x08\x23\x42\xb1\xc1\x15\x52\xd1\xf0" ++ "\x24\x33\x62\x72\x82\x09\x0a\x16\x17\x18\x19\x1a\x25\x26\x27" ++ "\x28\x29\x2a\x34\x35\x36\x37\x38\x39\x3a\x43\x44\x45\x46\x47" ++ "\x48\x49\x4a\x53\x54\x55\x56\x57\x58\x59\x5a\x63\x64\x65\x66" ++ "\x67\x68\x69\x6a\x73\x74\x75\x76\x77\x78\x79\x7a\x83\x84\x85" ++ "\x86\x87\x88\x89\x8a\x92\x93\x94\x95\x96\x97\x98\x99\x9a\xa2" ++ "\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xb2\xb3\xb4\xb5\xb6\xb7\xb8" ++ "\xb9\xba\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xd2\xd3\xd4\xd5" ++ "\xd6\xd7\xd8\xd9\xda\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea" ++ "\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xff\xda\x00\x0e\x04" ++ "\x43\x00\x4d\x00\x59\x00\x4b\x00\x00\x3f\x00\xfa\xf7\xf6\x92" ++ "\xff\x00\x97\xaf\xc6\xba\x8f\xf8\x79\x27\xfd\x45\x3f\xf2\x25" ++ "\x7b\x9f\xc6\xdf\x8d\xbf\xf1\xf1\xfe\x91\xeb\xde\xbf\x44\x7e" ++ "\x20\x7f\xcb\x4f\xc6\xbf\x2a\xbf\x69\x2f\xf9\x7a\xfc\x68\xff" ++ "\x00\x87\x92\x7f\xd4\x53\xff\x00\x22\x57\xc1\x3f\x15\xfe\x2b" ++ "\xdf\x6b\xfa\xac\x5a\x66\x99\x15\xc6\xa3\xa9\x5e\xcc\xb6\xd6" ++ "\xb6\x76\x91\xb4\xb3\x4f\x2b\xb0\x54\x8d\x11\x41\x2c\xcc\xc4" ++ "\x00\xa0\x12\x49\x00\x57\xcd\x5f\x10\x3f\xe5\xa7\xe3\x5f\xaa" ++ "\xbf\xb4\x97\xfc\xbd\x7e\x34\x7f\xc3\xc9\x3f\xea\x29\xff\x00" ++ "\x91\x2b\xec\x0f\xd9\x7f\xf6\x5f\xb1\xfd\x99\xf4\xaf\xf8\x4e" ++ "\x3c\x71\xf6\x7d\x47\xe2\xad\xec\x2c\x11\x03\xac\xb0\xe8\x31" ++ "\x3a\x90\xd0\xc2\xc3\x21\xa7\x65\x25\x64\x98\x64\x60\x98\xe3" ++ "\x3b\x37\xbc\xdf\x35\x7c\x40\xff\x00\x96\x9f\x8d\x1f\xb4\x97" ++ "\xfc\xbd\x7e\x34\x7f\xc3\xc9\x3f\xea\x29\xff\x00\x91\x2b\xe3" ++ "\xff\x00\x8a\xff\x00\x15\xef\xb5\xfd\x56\x2d\x33\x4c\x8a\xe3" ++ "\x51\xd4\xaf\x66\x5b\x6b\x5b\x3b\x48\xda\x59\xa7\x95\xd8\x2a" ++ "\x46\x88\xa0\x96\x66\x62\x00\x50\x09\x24\x80\x2b\xf4\xab\xe2" ++ "\x07\xfc\xb4\xfc\x6b\xf2\xab\xf6\x92\xff\x00\x97\xaf\xc6\x8f" ++ "\xf8\x79\x27\xfd\x45\x3f\xf2\x25\x7d\x81\xfb\x2f\xfe\xcb\xf6" ++ "\x3f\xb3\x3e\x95\xff\x00\x09\xc7\x8e\x3e\xcf\xa8\xfc\x55\xbd" ++ "\x85\x82\x20\x75\x96\x1d\x06\x27\x52\x1a\x18\x58\x64\x34\xec" ++ "\xa4\xac\x93\x0c\x8c\x13\x1c\x67\x66\xf7\x9b\xe6\xaf\x88\x1f" ++ "\xf2\xd3\xf1\xaf\xd5\x5f\xda\x4b\xfe\x5e\xbf\x1a\x3f\xe1\xe4" ++ "\x9f\xf5\x14\xff\x00\xc8\x95\xcf\xfc\x6d\xf8\xdb\xff\x00\x1f" ++ "\x1f\xe9\x1e\xbd\xeb\xe6\xaf\x88\x1f\xf2\xd3\xf1\xaf\xff\xd9", // baseline, 4:4:4, no subsampling "\xff\xd8\xff\xe0\x00\x10\x4a\x46\x49\x46\x00\x01\x01\x00\x00" ++ "\x01\x00\x01\x00\x00\xff\xdb\x00\x43\x00\x03\x02\x02\x03\x02" ++ "\x02\x03\x03\x03\x03\x04\x03\x03\x04\x05\x08\x05\x05\x04\x04" ++ "\x05\x0a\x07\x07\x06\x08\x0c\x0a\x0c\x0c\x0b\x0a\x0b\x0b\x0d" ++ "\x0e\x12\x10\x0d\x0e\x11\x0e\x0b\x0b\x10\x16\x10\x11\x13\x14" ++ "\x15\x15\x15\x0c\x0f\x17\x18\x16\x14\x18\x12\x14\x15\x14\xff" ++ "\xdb\x00\x43\x01\x03\x04\x04\x05\x04\x05\x09\x05\x05\x09\x14" ++ "\x0d\x0b\x0d\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14" ++ "\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14" ++ "\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14" ++ "\x14\x14\x14\x14\x14\x14\x14\x14\xff\xc0\x00\x11\x08\x00\x10" ++ "\x00\x18\x03\x01\x11\x00\x02\x11\x01\x03\x11\x01\xff\xc4\x00" ++ "\x1f\x00\x00\x01\x05\x01\x01\x01\x01\x01\x01\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b" ++ "\xff\xc4\x00\xb5\x10\x00\x02\x01\x03\x03\x02\x04\x03\x05\x05" ++ "\x04\x04\x00\x00\x01\x7d\x01\x02\x03\x00\x04\x11\x05\x12\x21" ++ "\x31\x41\x06\x13\x51\x61\x07\x22\x71\x14\x32\x81\x91\xa1\x08" ++ "\x23\x42\xb1\xc1\x15\x52\xd1\xf0\x24\x33\x62\x72\x82\x09\x0a" ++ "\x16\x17\x18\x19\x1a\x25\x26\x27\x28\x29\x2a\x34\x35\x36\x37" ++ "\x38\x39\x3a\x43\x44\x45\x46\x47\x48\x49\x4a\x53\x54\x55\x56" ++ "\x57\x58\x59\x5a\x63\x64\x65\x66\x67\x68\x69\x6a\x73\x74\x75" ++ "\x76\x77\x78\x79\x7a\x83\x84\x85\x86\x87\x88\x89\x8a\x92\x93" ++ "\x94\x95\x96\x97\x98\x99\x9a\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9" ++ "\xaa\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xc2\xc3\xc4\xc5\xc6" ++ "\xc7\xc8\xc9\xca\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xe1\xe2" ++ "\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xf1\xf2\xf3\xf4\xf5\xf6\xf7" ++ "\xf8\xf9\xfa\xff\xc4\x00\x1f\x01\x00\x03\x01\x01\x01\x01\x01" ++ "\x01\x01\x01\x01\x00\x00\x00\x00\x00\x00\x01\x02\x03\x04\x05" ++ "\x06\x07\x08\x09\x0a\x0b\xff\xc4\x00\xb5\x11\x00\x02\x01\x02" ++ "\x04\x04\x03\x04\x07\x05\x04\x04\x00\x01\x02\x77\x00\x01\x02" ++ "\x03\x11\x04\x05\x21\x31\x06\x12\x41\x51\x07\x61\x71\x13\x22" ++ "\x32\x81\x08\x14\x42\x91\xa1\xb1\xc1\x09\x23\x33\x52\xf0\x15" ++ "\x62\x72\xd1\x0a\x16\x24\x34\xe1\x25\xf1\x17\x18\x19\x1a\x26" ++ "\x27\x28\x29\x2a\x35\x36\x37\x38\x39\x3a\x43\x44\x45\x46\x47" ++ "\x48\x49\x4a\x53\x54\x55\x56\x57\x58\x59\x5a\x63\x64\x65\x66" ++ "\x67\x68\x69\x6a\x73\x74\x75\x76\x77\x78\x79\x7a\x82\x83\x84" ++ "\x85\x86\x87\x88\x89\x8a\x92\x93\x94\x95\x96\x97\x98\x99\x9a" ++ "\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xb2\xb3\xb4\xb5\xb6\xb7" ++ "\xb8\xb9\xba\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xd2\xd3\xd4" ++ "\xd5\xd6\xd7\xd8\xd9\xda\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea" ++ "\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xff\xda\x00\x0c\x03\x01" ++ "\x00\x02\x11\x03\x11\x00\x3f\x00\xf8\x9f\xc3\x9f\x0a\x3e\xef" ++ "\xee\x7f\x4a\xbc\x3d\x73\xc8\xca\xf3\xfd\xb5\x3d\x43\xc3\xbf" ++ "\x09\xfe\xef\xee\x7f\x4a\xfa\x7c\x3d\x73\xf5\xfc\xaf\x3f\xdb" ++ "\x53\xd4\x7c\x39\xf0\x9f\xee\xfe\xe7\xf4\xaf\xa7\xc3\xd7\x3f" ++ "\x5e\xca\xf3\xfd\xb5\x3a\xcf\x0e\x7c\x27\xfb\xbf\xb9\xfd\x2b" ++ "\xf1\x2c\x3d\x73\xfc\xb0\xca\xf3\xfd\xb5\x3d\x43\xc3\xbf\x09" ++ "\xfe\xef\xee\x7f\x4a\xfa\x7c\x3d\x73\xf5\xfc\xaf\x3f\xdb\x53" ++ "\xd3\x74\x4f\x85\xf1\xda\xc3\xe6\xcb\x18\x48\xd0\x64\xb1\x1d" ++ "\x2b\xd6\xc4\x66\xf8\x5c\xab\x0b\x3c\x6e\x36\xa2\x85\x28\x2b" ++ "\xb6\xfa\x7e\xad\xb7\xa2\x4a\xed\xb6\x92\x4d\xbb\x1f\xb0\xe5" ++ "\x19\xec\xa7\x28\xc6\x2e\xed\x9f\xff\xd9", // baseline, 4:2:0 chroma "\xff\xd8\xff\xe0\x00\x10\x4a\x46\x49\x46\x00\x01\x01\x00\x00" ++ "\x01\x00\x01\x00\x00\xff\xdb\x00\x43\x00\x03\x02\x02\x03\x02" ++ "\x02\x03\x03\x03\x03\x04\x03\x03\x04\x05\x08\x05\x05\x04\x04" ++ "\x05\x0a\x07\x07\x06\x08\x0c\x0a\x0c\x0c\x0b\x0a\x0b\x0b\x0d" ++ "\x0e\x12\x10\x0d\x0e\x11\x0e\x0b\x0b\x10\x16\x10\x11\x13\x14" ++ "\x15\x15\x15\x0c\x0f\x17\x18\x16\x14\x18\x12\x14\x15\x14\xff" ++ "\xdb\x00\x43\x01\x03\x04\x04\x05\x04\x05\x09\x05\x05\x09\x14" ++ "\x0d\x0b\x0d\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14" ++ "\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14" ++ "\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14" ++ "\x14\x14\x14\x14\x14\x14\x14\x14\xff\xc0\x00\x11\x08\x00\x10" ++ "\x00\x18\x03\x01\x22\x00\x02\x11\x01\x03\x11\x01\xff\xc4\x00" ++ "\x1f\x00\x00\x01\x05\x01\x01\x01\x01\x01\x01\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b" ++ "\xff\xc4\x00\xb5\x10\x00\x02\x01\x03\x03\x02\x04\x03\x05\x05" ++ "\x04\x04\x00\x00\x01\x7d\x01\x02\x03\x00\x04\x11\x05\x12\x21" ++ "\x31\x41\x06\x13\x51\x61\x07\x22\x71\x14\x32\x81\x91\xa1\x08" ++ "\x23\x42\xb1\xc1\x15\x52\xd1\xf0\x24\x33\x62\x72\x82\x09\x0a" ++ "\x16\x17\x18\x19\x1a\x25\x26\x27\x28\x29\x2a\x34\x35\x36\x37" ++ "\x38\x39\x3a\x43\x44\x45\x46\x47\x48\x49\x4a\x53\x54\x55\x56" ++ "\x57\x58\x59\x5a\x63\x64\x65\x66\x67\x68\x69\x6a\x73\x74\x75" ++ "\x76\x77\x78\x79\x7a\x83\x84\x85\x86\x87\x88\x89\x8a\x92\x93" ++ "\x94\x95\x96\x97\x98\x99\x9a\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9" ++ "\xaa\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xc2\xc3\xc4\xc5\xc6" ++ "\xc7\xc8\xc9\xca\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xe1\xe2" ++ "\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xf1\xf2\xf3\xf4\xf5\xf6\xf7" ++ "\xf8\xf9\xfa\xff\xc4\x00\x1f\x01\x00\x03\x01\x01\x01\x01\x01" ++ "\x01\x01\x01\x01\x00\x00\x00\x00\x00\x00\x01\x02\x03\x04\x05" ++ "\x06\x07\x08\x09\x0a\x0b\xff\xc4\x00\xb5\x11\x00\x02\x01\x02" ++ "\x04\x04\x03\x04\x07\x05\x04\x04\x00\x01\x02\x77\x00\x01\x02" ++ "\x03\x11\x04\x05\x21\x31\x06\x12\x41\x51\x07\x61\x71\x13\x22" ++ "\x32\x81\x08\x14\x42\x91\xa1\xb1\xc1\x09\x23\x33\x52\xf0\x15" ++ "\x62\x72\xd1\x0a\x16\x24\x34\xe1\x25\xf1\x17\x18\x19\x1a\x26" ++ "\x27\x28\x29\x2a\x35\x36\x37\x38\x39\x3a\x43\x44\x45\x46\x47" ++ "\x48\x49\x4a\x53\x54\x55\x56\x57\x58\x59\x5a\x63\x64\x65\x66" ++ "\x67\x68\x69\x6a\x73\x74\x75\x76\x77\x78\x79\x7a\x82\x83\x84" ++ "\x85\x86\x87\x88\x89\x8a\x92\x93\x94\x95\x96\x97\x98\x99\x9a" ++ "\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xb2\xb3\xb4\xb5\xb6\xb7" ++ "\xb8\xb9\xba\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xd2\xd3\xd4" ++ "\xd5\xd6\xd7\xd8\xd9\xda\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea" ++ "\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xff\xda\x00\x0c\x03\x01" ++ "\x00\x02\x11\x03\x11\x00\x3f\x00\xf8\x9f\xc3\x9f\x0a\x3e\xef" ++ "\xee\x7f\x4a\xf5\x0f\x0e\xfc\x27\xfb\xbf\xb9\xfd\x2b\xdf\x7c" ++ "\x39\xf0\x9f\xee\xfe\xe7\xf4\xaf\x50\xf0\xef\xc2\x7f\xbb\xfb" ++ "\x9f\xd2\xb7\xcb\xb1\xbb\x6a\x7c\x7f\x0b\x71\xf7\xc3\xef\x9e" ++ "\x07\xe1\xcf\x84\xff\x00\x77\xf7\x3f\xa5\x15\xf6\x4e\x89\xf0" ++ "\xbe\x3b\x58\x7c\xd9\x63\x09\x1a\x0c\x96\x23\xa5\x15\xf5\x35" ++ "\xb8\xa3\x2b\xcb\x39\x69\xe3\xb1\x74\xe9\x49\xab\xa5\x39\xc6" ++ "\x2d\xad\xae\x93\x6b\x43\xfa\x9b\x2a\xe3\xa9\xcf\x0e\x9c\x5b" ++ "\x67\xff\xd9", // a single component "\xff\xd8\xff\xe0\x00\x10\x4a\x46\x49\x46\x00\x01\x01\x00\x00" ++ "\x01\x00\x01\x00\x00\xff\xdb\x00\x43\x00\x03\x02\x02\x03\x02" ++ "\x02\x03\x03\x03\x03\x04\x03\x03\x04\x05\x08\x05\x05\x04\x04" ++ "\x05\x0a\x07\x07\x06\x08\x0c\x0a\x0c\x0c\x0b\x0a\x0b\x0b\x0d" ++ "\x0e\x12\x10\x0d\x0e\x11\x0e\x0b\x0b\x10\x16\x10\x11\x13\x14" ++ "\x15\x15\x15\x0c\x0f\x17\x18\x16\x14\x18\x12\x14\x15\x14\xff" ++ "\xc0\x00\x0b\x08\x00\x10\x00\x18\x01\x01\x11\x00\xff\xc4\x00" ++ "\x1f\x00\x00\x01\x05\x01\x01\x01\x01\x01\x01\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b" ++ "\xff\xc4\x00\xb5\x10\x00\x02\x01\x03\x03\x02\x04\x03\x05\x05" ++ "\x04\x04\x00\x00\x01\x7d\x01\x02\x03\x00\x04\x11\x05\x12\x21" ++ "\x31\x41\x06\x13\x51\x61\x07\x22\x71\x14\x32\x81\x91\xa1\x08" ++ "\x23\x42\xb1\xc1\x15\x52\xd1\xf0\x24\x33\x62\x72\x82\x09\x0a" ++ "\x16\x17\x18\x19\x1a\x25\x26\x27\x28\x29\x2a\x34\x35\x36\x37" ++ "\x38\x39\x3a\x43\x44\x45\x46\x47\x48\x49\x4a\x53\x54\x55\x56" ++ "\x57\x58\x59\x5a\x63\x64\x65\x66\x67\x68\x69\x6a\x73\x74\x75" ++ "\x76\x77\x78\x79\x7a\x83\x84\x85\x86\x87\x88\x89\x8a\x92\x93" ++ "\x94\x95\x96\x97\x98\x99\x9a\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9" ++ "\xaa\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xc2\xc3\xc4\xc5\xc6" ++ "\xc7\xc8\xc9\xca\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xe1\xe2" ++ "\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xf1\xf2\xf3\xf4\xf5\xf6\xf7" ++ "\xf8\xf9\xfa\xff\xda\x00\x08\x01\x01\x00\x00\x3f\x00\xf8\xb3" ++ "\xe1\x6f\x84\x7f\xd4\xfc\x9e\x9d\xab\xec\x0f\x85\xbe\x11\xff" ++ "\x00\x53\xf2\x7a\x76\xaf\xb0\x3e\x16\xf8\x47\xfd\x4f\xc9\xe9" ++ "\xda\xbf\x3a\xbe\x16\xf8\x47\xfd\x4f\xc9\xe9\xda\xbe\xc0\xf8" ++ "\x5b\xe1\x1f\xf5\x3f\x27\xa7\x6a\xf4\x0f\xda\x63\xe2\xf7\xfc" ++ "\x33\x17\xec\xe1\xae\x78\xaa\xcd\xbc\xaf\x12\x5e\x6d\xd2\x34" ++ "\x1f\x93\x38\xbf\x99\x5b\x64\x9c\xc6\xe9\xfb\xa4\x49\x67\xdb" ++ "\x20\xda\xfe\x4e\xc2\x41\x71\x5f\xff\xd9", // progressive, 4:4:4 "\xff\xd8\xff\xe0\x00\x10\x4a\x46\x49\x46\x00\x01\x01\x00\x00" ++ "\x01\x00\x01\x00\x00\xff\xdb\x00\x43\x00\x03\x02\x02\x03\x02" ++ "\x02\x03\x03\x03\x03\x04\x03\x03\x04\x05\x08\x05\x05\x04\x04" ++ "\x05\x0a\x07\x07\x06\x08\x0c\x0a\x0c\x0c\x0b\x0a\x0b\x0b\x0d" ++ "\x0e\x12\x10\x0d\x0e\x11\x0e\x0b\x0b\x10\x16\x10\x11\x13\x14" ++ "\x15\x15\x15\x0c\x0f\x17\x18\x16\x14\x18\x12\x14\x15\x14\xff" ++ "\xdb\x00\x43\x01\x03\x04\x04\x05\x04\x05\x09\x05\x05\x09\x14" ++ "\x0d\x0b\x0d\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14" ++ "\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14" ++ "\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14" ++ "\x14\x14\x14\x14\x14\x14\x14\x14\xff\xc2\x00\x11\x08\x00\x10" ++ "\x00\x18\x03\x01\x11\x00\x02\x11\x01\x03\x11\x01\xff\xc4\x00" ++ "\x16\x00\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x06\x05\x07\xff\xc4\x00\x18\x01\x00\x03\x01\x01" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x05\x06" ++ "\x01\x08\xff\xda\x00\x0c\x03\x01\x00\x02\x10\x03\x10\x00\x00" ++ "\x01\xc4\xf4\x35\x0d\x2c\x14\x33\xaf\xad\x13\xca\xea\x19\xd8" ++ "\x27\x2e\xc3\xff\xc4\x00\x19\x10\x00\x03\x01\x01\x01\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x05\x01\x02\x03" ++ "\xff\xda\x00\x08\x01\x01\x00\x01\x05\x02\x5e\x50\xbc\x91\x79" ++ "\x22\xf2\x45\xe4\x9e\x32\xf3\x9c\xff\xc4\x00\x16\x11\x01\x01" ++ "\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04" ++ "\x00\x01\xff\xda\x00\x08\x01\x03\x01\x01\x3f\x01\x2b\xe2\xbe" ++ "\x2b\xe2\xbe\x2b\xe2\x3b\x77\x73\x32\xff\xc4\x00\x19\x11\x00" ++ "\x03\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x02\x03\x01\x04\x11\xff\xda\x00\x08\x01\x02\x01\x01\x3f" ++ "\x01\x9b\x93\x72\x6e\x4d\xc9\xb9\x4e\xb9\x72\xcb\x6d\x66\xf1" ++ "\x70\xff\xc4\x00\x18\x10\x01\x01\x01\x01\x01\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x31\x01\x11\x21\xff\xda\x00" ++ "\x08\x01\x01\x00\x06\x3f\x02\x88\x88\x8e\xee\x78\xff\xc4\x00" ++ "\x18\x10\x01\x01\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x31\x01\x21\x41\xff\xda\x00\x08\x01\x01\x00" ++ "\x01\x3f\x21\x9b\x26\x4c\x99\x3a\x98\xc3\xaf\xff\xda\x00\x0c" ++ "\x03\x01\x00\x02\x00\x03\x00\x00\x00\x10\x63\x5c\xff\x00\xff" ++ "\xc4\x00\x18\x11\x00\x03\x01\x01\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x21\x31\x01\x11\xff\xda\x00\x08\x01" ++ "\x03\x01\x01\x3f\x10\x8b\x22\xc8\xb2\x2c\x8b\x37\x43\xbb\xa7" ++ "\xff\xc4\x00\x1a\x11\x01\x00\x01\x05\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x01\x11\x00\x20\x21\x41\xc1\xff\xda" ++ "\x00\x08\x01\x02\x01\x01\x3f\x10\xb5\x55\x15\xc7\x95\x75\xd5" ++ "\x5c\x01\x2a\xa0\x0a\xc5\x7f\xff\xc4\x00\x18\x10\x00\x03\x01" ++ "\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01" ++ "\xf1\x11\x31\xff\xda\x00\x08\x01\x01\x00\x01\x3f\x10\x98\x40" ++ "\x24\x12\x08\x06\x43\x2b\xad\x97\x0f\xff\xd9", // progressive, 4:2:0, the commonest shape on the web "\xff\xd8\xff\xe0\x00\x10\x4a\x46\x49\x46\x00\x01\x01\x00\x00" ++ "\x01\x00\x01\x00\x00\xff\xdb\x00\x43\x00\x05\x03\x04\x04\x04" ++ "\x03\x05\x04\x04\x04\x05\x05\x05\x06\x07\x0c\x08\x07\x07\x07" ++ "\x07\x0f\x0b\x0b\x09\x0c\x11\x0f\x12\x12\x11\x0f\x11\x11\x13" ++ "\x16\x1c\x17\x13\x14\x1a\x15\x11\x11\x18\x21\x18\x1a\x1d\x1d" ++ "\x1f\x1f\x1f\x13\x17\x22\x24\x22\x1e\x24\x1c\x1e\x1f\x1e\xff" ++ "\xdb\x00\x43\x01\x05\x05\x05\x07\x06\x07\x0e\x08\x08\x0e\x1e" ++ "\x14\x11\x14\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e" ++ "\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e" ++ "\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e" ++ "\x1e\x1e\x1e\x1e\x1e\x1e\x1e\x1e\xff\xc2\x00\x11\x08\x00\x10" ++ "\x00\x18\x03\x01\x22\x00\x02\x11\x01\x03\x11\x01\xff\xc4\x00" ++ "\x17\x00\x00\x03\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x05\x06\x07\xff\xc4\x00\x16\x01\x01\x01\x01" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x02" ++ "\x06\xff\xda\x00\x0c\x03\x01\x00\x02\x10\x03\x10\x00\x00\x01" ++ "\xcf\x9c\x52\xb9\xa0\x4c\x97\xa3\x36\x5f\xff\xc4\x00\x18\x10" ++ "\x00\x03\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x03\x04\x01\x11\xff\xda\x00\x08\x01\x01\x00\x01\x05" ++ "\x02\x54\x82\xa4\x15\x20\xa9\x05\x48\x2e\x5e\x67\xff\xc4\x00" ++ "\x19\x11\x00\x03\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x01\x05\x02\x04\x61\xff\xda\x00\x08\x01\x03" ++ "\x01\x01\x3f\x01\x9f\x67\xa6\xbd\x76\xf0\x3f\xff\xc4\x00\x1a" ++ "\x11\x00\x02\x02\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x01\x03\x00\x02\x05\x21\x71\xff\xda\x00\x08\x01\x02" ++ "\x01\x01\x3f\x01\x4b\x65\xb2\x08\x4e\x99\x70\x3a\x67\xff\xc4" ++ "\x00\x17\x10\x01\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x31\x01\x11\xff\xda\x00\x08\x01\x01\x00" ++ "\x06\x3f\x02\x88\x88\x8e\xeb\xff\xc4\x00\x17\x10\x00\x03\x01" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01" ++ "\x11\x20\xff\xda\x00\x08\x01\x01\x00\x01\x3f\x21\xcc\x92\x45" ++ "\x40\x89\x1f\xff\xda\x00\x0c\x03\x01\x00\x02\x00\x03\x00\x00" ++ "\x00\x10\x67\x3f\xff\xc4\x00\x17\x11\x00\x03\x01\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x11\x31\xff" ++ "\xda\x00\x08\x01\x03\x01\x01\x3f\x10\xc0\x20\x47\x4f\xff\xc4" ++ "\x00\x18\x11\x01\x01\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x01\x11\x00\x21\x81\xff\xda\x00\x08\x01\x02" ++ "\x01\x01\x3f\x10\xdc\x97\xef\x60\x0c\xf5\xdf\xff\xc4\x00\x18" ++ "\x10\x00\x03\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" ++ "\x00\x00\x00\x01\x31\xc1\x11\xff\xda\x00\x08\x01\x01\x00\x01" ++ "\x3f\x10\x96\x49\x64\x96\x49\x64\x96\x4e\x18\xa1\xd6\xda\x3f" ++ "\xff\xd9", // restart markers every two MCU rows "\xff\xd8\xff\xe0\x00\x10\x4a\x46\x49\x46\x00\x01\x01\x00\x00" ++ "\x01\x00\x01\x00\x00\xff\xdb\x00\x43\x00\x03\x02\x02\x03\x02" ++ "\x02\x03\x03\x03\x03\x04\x03\x03\x04\x05\x08\x05\x05\x04\x04" ++ "\x05\x0a\x07\x07\x06\x08\x0c\x0a\x0c\x0c\x0b\x0a\x0b\x0b\x0d" ++ "\x0e\x12\x10\x0d\x0e\x11\x0e\x0b\x0b\x10\x16\x10\x11\x13\x14" ++ "\x15\x15\x15\x0c\x0f\x17\x18\x16\x14\x18\x12\x14\x15\x14\xff" ++ "\xdb\x00\x43\x01\x03\x04\x04\x05\x04\x05\x09\x05\x05\x09\x14" ++ "\x0d\x0b\x0d\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14" ++ "\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14" ++ "\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14" ++ "\x14\x14\x14\x14\x14\x14\x14\x14\xff\xc0\x00\x11\x08\x00\x10" ++ "\x00\x18\x03\x01\x11\x00\x02\x11\x01\x03\x11\x01\xff\xc4\x00" ++ "\x1f\x00\x00\x01\x05\x01\x01\x01\x01\x01\x01\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b" ++ "\xff\xc4\x00\xb5\x10\x00\x02\x01\x03\x03\x02\x04\x03\x05\x05" ++ "\x04\x04\x00\x00\x01\x7d\x01\x02\x03\x00\x04\x11\x05\x12\x21" ++ "\x31\x41\x06\x13\x51\x61\x07\x22\x71\x14\x32\x81\x91\xa1\x08" ++ "\x23\x42\xb1\xc1\x15\x52\xd1\xf0\x24\x33\x62\x72\x82\x09\x0a" ++ "\x16\x17\x18\x19\x1a\x25\x26\x27\x28\x29\x2a\x34\x35\x36\x37" ++ "\x38\x39\x3a\x43\x44\x45\x46\x47\x48\x49\x4a\x53\x54\x55\x56" ++ "\x57\x58\x59\x5a\x63\x64\x65\x66\x67\x68\x69\x6a\x73\x74\x75" ++ "\x76\x77\x78\x79\x7a\x83\x84\x85\x86\x87\x88\x89\x8a\x92\x93" ++ "\x94\x95\x96\x97\x98\x99\x9a\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9" ++ "\xaa\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xc2\xc3\xc4\xc5\xc6" ++ "\xc7\xc8\xc9\xca\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xe1\xe2" ++ "\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xf1\xf2\xf3\xf4\xf5\xf6\xf7" ++ "\xf8\xf9\xfa\xff\xc4\x00\x1f\x01\x00\x03\x01\x01\x01\x01\x01" ++ "\x01\x01\x01\x01\x00\x00\x00\x00\x00\x00\x01\x02\x03\x04\x05" ++ "\x06\x07\x08\x09\x0a\x0b\xff\xc4\x00\xb5\x11\x00\x02\x01\x02" ++ "\x04\x04\x03\x04\x07\x05\x04\x04\x00\x01\x02\x77\x00\x01\x02" ++ "\x03\x11\x04\x05\x21\x31\x06\x12\x41\x51\x07\x61\x71\x13\x22" ++ "\x32\x81\x08\x14\x42\x91\xa1\xb1\xc1\x09\x23\x33\x52\xf0\x15" ++ "\x62\x72\xd1\x0a\x16\x24\x34\xe1\x25\xf1\x17\x18\x19\x1a\x26" ++ "\x27\x28\x29\x2a\x35\x36\x37\x38\x39\x3a\x43\x44\x45\x46\x47" ++ "\x48\x49\x4a\x53\x54\x55\x56\x57\x58\x59\x5a\x63\x64\x65\x66" ++ "\x67\x68\x69\x6a\x73\x74\x75\x76\x77\x78\x79\x7a\x82\x83\x84" ++ "\x85\x86\x87\x88\x89\x8a\x92\x93\x94\x95\x96\x97\x98\x99\x9a" ++ "\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xb2\xb3\xb4\xb5\xb6\xb7" ++ "\xb8\xb9\xba\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xd2\xd3\xd4" ++ "\xd5\xd6\xd7\xd8\xd9\xda\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea" ++ "\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xff\xdd\x00\x04\x00\x06" ++ "\xff\xda\x00\x0c\x03\x01\x00\x02\x11\x03\x11\x00\x3f\x00\xf8" ++ "\x9f\xc3\x9f\x0a\x3e\xef\xee\x7f\x4a\xbc\x3d\x73\xc8\xca\xf3" ++ "\xfd\xb5\x3d\x43\xc3\xbf\x09\xfe\xef\xee\x7f\x4a\xfa\x7c\x3d" ++ "\x73\xf5\xfc\xaf\x3f\xdb\x53\xd4\x7c\x39\xf0\x9f\xee\xfe\xe7" ++ "\xf4\xaf\xa7\xc3\xd7\x3f\x5e\xca\xf3\xfd\xb5\x3a\xcf\x0e\x7c" ++ "\x27\xfb\xbf\xb9\xfd\x2b\xf1\x2c\x3d\x73\xfc\xb0\xca\xf3\xfd" ++ "\xb5\x3d\x43\xc3\xbf\x09\xfe\xef\xee\x7f\x4a\xfa\x7c\x3d\x73" ++ "\xf5\xfc\xaf\x3f\xdb\x53\xd3\x74\x4f\x85\xf1\xda\xc3\xe6\xcb" ++ "\x18\x48\xd0\x64\xb1\x1d\x2b\xd6\xc4\x66\xf8\x5c\xab\x0b\x3c" ++ "\x6e\x36\xa2\x85\x28\x2b\xb6\xfa\x7e\xad\xb7\xa2\x4a\xed\xb6" ++ "\x92\x4d\xbb\x1f\xb0\xe5\x19\xec\xa7\x28\xc6\x2e\xed\x9f\xff" ++ "\xd9", // 13x7 at 4:2:0, so the last MCU hangs off two edges "\xff\xd8\xff\xe0\x00\x10\x4a\x46\x49\x46\x00\x01\x01\x00\x00" ++ "\x01\x00\x01\x00\x00\xff\xdb\x00\x43\x00\x03\x02\x02\x03\x02" ++ "\x02\x03\x03\x03\x03\x04\x03\x03\x04\x05\x08\x05\x05\x04\x04" ++ "\x05\x0a\x07\x07\x06\x08\x0c\x0a\x0c\x0c\x0b\x0a\x0b\x0b\x0d" ++ "\x0e\x12\x10\x0d\x0e\x11\x0e\x0b\x0b\x10\x16\x10\x11\x13\x14" ++ "\x15\x15\x15\x0c\x0f\x17\x18\x16\x14\x18\x12\x14\x15\x14\xff" ++ "\xdb\x00\x43\x01\x03\x04\x04\x05\x04\x05\x09\x05\x05\x09\x14" ++ "\x0d\x0b\x0d\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14" ++ "\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14" ++ "\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14\x14" ++ "\x14\x14\x14\x14\x14\x14\x14\x14\xff\xc0\x00\x11\x08\x00\x07" ++ "\x00\x0d\x03\x01\x22\x00\x02\x11\x01\x03\x11\x01\xff\xc4\x00" ++ "\x1f\x00\x00\x01\x05\x01\x01\x01\x01\x01\x01\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b" ++ "\xff\xc4\x00\xb5\x10\x00\x02\x01\x03\x03\x02\x04\x03\x05\x05" ++ "\x04\x04\x00\x00\x01\x7d\x01\x02\x03\x00\x04\x11\x05\x12\x21" ++ "\x31\x41\x06\x13\x51\x61\x07\x22\x71\x14\x32\x81\x91\xa1\x08" ++ "\x23\x42\xb1\xc1\x15\x52\xd1\xf0\x24\x33\x62\x72\x82\x09\x0a" ++ "\x16\x17\x18\x19\x1a\x25\x26\x27\x28\x29\x2a\x34\x35\x36\x37" ++ "\x38\x39\x3a\x43\x44\x45\x46\x47\x48\x49\x4a\x53\x54\x55\x56" ++ "\x57\x58\x59\x5a\x63\x64\x65\x66\x67\x68\x69\x6a\x73\x74\x75" ++ "\x76\x77\x78\x79\x7a\x83\x84\x85\x86\x87\x88\x89\x8a\x92\x93" ++ "\x94\x95\x96\x97\x98\x99\x9a\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9" ++ "\xaa\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xc2\xc3\xc4\xc5\xc6" ++ "\xc7\xc8\xc9\xca\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xe1\xe2" ++ "\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xf1\xf2\xf3\xf4\xf5\xf6\xf7" ++ "\xf8\xf9\xfa\xff\xc4\x00\x1f\x01\x00\x03\x01\x01\x01\x01\x01" ++ "\x01\x01\x01\x01\x00\x00\x00\x00\x00\x00\x01\x02\x03\x04\x05" ++ "\x06\x07\x08\x09\x0a\x0b\xff\xc4\x00\xb5\x11\x00\x02\x01\x02" ++ "\x04\x04\x03\x04\x07\x05\x04\x04\x00\x01\x02\x77\x00\x01\x02" ++ "\x03\x11\x04\x05\x21\x31\x06\x12\x41\x51\x07\x61\x71\x13\x22" ++ "\x32\x81\x08\x14\x42\x91\xa1\xb1\xc1\x09\x23\x33\x52\xf0\x15" ++ "\x62\x72\xd1\x0a\x16\x24\x34\xe1\x25\xf1\x17\x18\x19\x1a\x26" ++ "\x27\x28\x29\x2a\x35\x36\x37\x38\x39\x3a\x43\x44\x45\x46\x47" ++ "\x48\x49\x4a\x53\x54\x55\x56\x57\x58\x59\x5a\x63\x64\x65\x66" ++ "\x67\x68\x69\x6a\x73\x74\x75\x76\x77\x78\x79\x7a\x82\x83\x84" ++ "\x85\x86\x87\x88\x89\x8a\x92\x93\x94\x95\x96\x97\x98\x99\x9a" ++ "\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xb2\xb3\xb4\xb5\xb6\xb7" ++ "\xb8\xb9\xba\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xd2\xd3\xd4" ++ "\xd5\xd6\xd7\xd8\xd9\xda\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea" ++ "\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xff\xda\x00\x0c\x03\x01" ++ "\x00\x02\x11\x03\x11\x00\x3f\x00\xf0\xdf\x00\xfe\xcb\x96\xd3" ++ "\xf9\x7f\xba\x8b\xf3\x15\xf4\x27\x86\xbf\x64\x6b\x59\x2c\x01" ++ "\xf2\xa1\xed\xdc\x51\x45\x7c\x3e\x40\x96\x69\x0e\x6c\x57\xbc" ++ "\xcc\xfc\x3b\xe2\xfc\xe2\x14\x57\x2d\x6e\x87\xff\xd9", // a single pixel "\xff\xd8\xff\xe0\x00\x10\x4a\x46\x49\x46\x00\x01\x01\x00\x00" ++ "\x01\x00\x01\x00\x00\xff\xdb\x00\x43\x00\x02\x01\x01\x01\x01" ++ "\x01\x02\x01\x01\x01\x02\x02\x02\x02\x02\x04\x03\x02\x02\x02" ++ "\x02\x05\x04\x04\x03\x04\x06\x05\x06\x06\x06\x05\x06\x06\x06" ++ "\x07\x09\x08\x06\x07\x09\x07\x06\x06\x08\x0b\x08\x09\x0a\x0a" ++ "\x0a\x0a\x0a\x06\x08\x0b\x0c\x0b\x0a\x0c\x09\x0a\x0a\x0a\xff" ++ "\xdb\x00\x43\x01\x02\x02\x02\x02\x02\x02\x05\x03\x03\x05\x0a" ++ "\x07\x06\x07\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a" ++ "\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a" ++ "\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a" ++ "\x0a\x0a\x0a\x0a\x0a\x0a\x0a\x0a\xff\xc0\x00\x11\x08\x00\x01" ++ "\x00\x01\x03\x01\x11\x00\x02\x11\x01\x03\x11\x01\xff\xc4\x00" ++ "\x1f\x00\x00\x01\x05\x01\x01\x01\x01\x01\x01\x00\x00\x00\x00" ++ "\x00\x00\x00\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b" ++ "\xff\xc4\x00\xb5\x10\x00\x02\x01\x03\x03\x02\x04\x03\x05\x05" ++ "\x04\x04\x00\x00\x01\x7d\x01\x02\x03\x00\x04\x11\x05\x12\x21" ++ "\x31\x41\x06\x13\x51\x61\x07\x22\x71\x14\x32\x81\x91\xa1\x08" ++ "\x23\x42\xb1\xc1\x15\x52\xd1\xf0\x24\x33\x62\x72\x82\x09\x0a" ++ "\x16\x17\x18\x19\x1a\x25\x26\x27\x28\x29\x2a\x34\x35\x36\x37" ++ "\x38\x39\x3a\x43\x44\x45\x46\x47\x48\x49\x4a\x53\x54\x55\x56" ++ "\x57\x58\x59\x5a\x63\x64\x65\x66\x67\x68\x69\x6a\x73\x74\x75" ++ "\x76\x77\x78\x79\x7a\x83\x84\x85\x86\x87\x88\x89\x8a\x92\x93" ++ "\x94\x95\x96\x97\x98\x99\x9a\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9" ++ "\xaa\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xc2\xc3\xc4\xc5\xc6" ++ "\xc7\xc8\xc9\xca\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xe1\xe2" ++ "\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xf1\xf2\xf3\xf4\xf5\xf6\xf7" ++ "\xf8\xf9\xfa\xff\xc4\x00\x1f\x01\x00\x03\x01\x01\x01\x01\x01" ++ "\x01\x01\x01\x01\x00\x00\x00\x00\x00\x00\x01\x02\x03\x04\x05" ++ "\x06\x07\x08\x09\x0a\x0b\xff\xc4\x00\xb5\x11\x00\x02\x01\x02" ++ "\x04\x04\x03\x04\x07\x05\x04\x04\x00\x01\x02\x77\x00\x01\x02" ++ "\x03\x11\x04\x05\x21\x31\x06\x12\x41\x51\x07\x61\x71\x13\x22" ++ "\x32\x81\x08\x14\x42\x91\xa1\xb1\xc1\x09\x23\x33\x52\xf0\x15" ++ "\x62\x72\xd1\x0a\x16\x24\x34\xe1\x25\xf1\x17\x18\x19\x1a\x26" ++ "\x27\x28\x29\x2a\x35\x36\x37\x38\x39\x3a\x43\x44\x45\x46\x47" ++ "\x48\x49\x4a\x53\x54\x55\x56\x57\x58\x59\x5a\x63\x64\x65\x66" ++ "\x67\x68\x69\x6a\x73\x74\x75\x76\x77\x78\x79\x7a\x82\x83\x84" ++ "\x85\x86\x87\x88\x89\x8a\x92\x93\x94\x95\x96\x97\x98\x99\x9a" ++ "\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xb2\xb3\xb4\xb5\xb6\xb7" ++ "\xb8\xb9\xba\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xd2\xd3\xd4" ++ "\xd5\xd6\xd7\xd8\xd9\xda\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea" ++ "\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xff\xda\x00\x0c\x03\x01" ++ "\x00\x02\x11\x03\x11\x00\x3f\x00\xcf\xaf\xe5\x73\xfb\x60\xff" ++ "\xd9", }; /// WebPs to mutate. /// /// The container and the bitstream are two separate attack surfaces and these /// reach both: chunk lengths and a canvas that may disagree with the image it /// holds, and underneath that a prefix-coded stream whose code lengths, /// transform declarations and backward references are all read from the file. const webp_corpus = [_][]const u8{ // three colours, which is where the colour-indexing transform and // the pixel bundling live "RIFF6\x00\x00\x00WEBPVP8L*\x00\x00\x00/\x08\x80\x01\x00" ++ "\x17 \x10H\xda\x1fz\x8d\xf9\x17\x10\x14\xf9?\xda\xfc\x07_" ++ "\x0a\x08\x04(b\x85{\xce\x98nCD\xff{\xb0\xd28\xd3\x05", // the same picture encoded harder, so the encoder chose differently "RIFF.\x00\x00\x00WEBPVP8L!\x00\x00\x00/\x08\x80\x01\x00P" ++ "\xd0\xb6\x0d\x13\xfe\xa4\xf7/\x82\xf9\x9f\xff\xfe\x0b\x09" ++ "\x92\xa4\\!\x01\xb3\x04,\x835/@\x00", // a gradient: the predictor and cross-colour transforms "RIFF\xae\x00\x00\x00WEBPVP8L\xa2\x00\x00\x00/\x0a\x00\x02" ++ "\x00\x17#\x10 l8\xf1\xff\xe6a(\x94\xd8\xb6M\xdd\xf7\x7f" ++ "\xcf\xfc\x07#\x8a\xa2(\x8a\xa2(\xce\x7f\x02\x05+\x88\xac" ++ "\x9f\xd8\xfaH\xac\x97\xd4z\xc8\xac\x9b\xdc\xba(\xac\x93" ++ "\xd2:\xa8\xac\x9d\x9a\xc1A\x00\x00d\xabh\xb6\xad\xdb\xb6m" ++ "\xdbFD\xff\x03 %;\x98*w\xa6\xbb;H\xc9N(]\xe9\xce\xf6\x0f" ++ "\x88V\\\xe1L\xb57?\x00ANMF4\x00\x00\x00" ++ "\x00\x00\x00\x00\x00\x00\x08\x00\x00\x06\x00\x00\xc8\x00" ++ "\x00\x02VP8L\x1c\x00\x00\x00/\x08\x80\x01\x10\x0f0\xff\x11" ++ "\xf3\x1f\x0c\x82\x00\x92\x02^o\x99yv\x88\xe8\x7f\x0fF\xac" ++ "\x07", }; /// Every corpus, for the targets that take any format. const mixed_corpus = bmp_corpus ++ png_corpus ++ jpeg_corpus ++ embedded_corpus ++ xbm_corpus ++ xpm_corpus ++ gif_corpus ++ tga_corpus ++ netpbm_corpus ++ apng_corpus ++ pcx_corpus ++ ico_corpus ++ webp_corpus; // -- decoding ---------------------------------------------------------------- /// Whatever arrives, the decoder comes back, and anything it produces survives /// being written out and read again. fn decodeProperty(input: []const u8) !void { // Asking for the metadata as well, because those readers are only reached // when a caller wants them: the JPEG `APP2` collector and --- the one that // matters --- PNG's `iCCP`, which runs an inflater over attacker bytes. // That is where the standard library's flate panic lived. Asking also // turns on WebP's walk past the pixels, which is the only path in this // library that keeps reading a container after it has the image. var profile: std.ArrayList(u8) = .empty; defer profile.deinit(backing); var orientation: z2dimg.exif.Orientation = undefined; var reader: Io.Reader = .fixed(input); var sfc = z2dimg.decode(backing, &reader, .{ .limits = limits, .icc = &profile, .orientation = &orientation, }) catch return; defer sfc.deinit(backing); // Whatever came back is a profile and is within the budget, which is the // same promise the `icc` target checks against the reassembler alone. try testing.expect(profile.items.len <= limits.max_icc_bytes); if (profile.items.len != 0) { try testing.expect(z2dimg.icc.looksValid(profile.items)); } // A surface that came back is one the limits allowed. try testing.expect(sfc.getWidth() >= 1); try testing.expect(sfc.getHeight() >= 1); try testing.expect(sfc.getWidth() <= limits.max_width); try testing.expect(sfc.getHeight() <= limits.max_height); // And it must survive a round trip through the encoder. An encoder that // cannot write what the decoder just read is a hole between the two, and // this is the only thing that looks for one. var list: std.ArrayList(u8) = .empty; defer list.deinit(backing); var w: Io.Writer.Allocating = .fromArrayList(backing, &list); defer list = w.toArrayList(); z2dimg.encode(backing, &sfc, &w.writer, .{ .bmp = .{} }) catch |err| switch (err) { // The only legitimate refusal: an image too large to describe in a // BMP header, which the limits above make unreachable, but which the // encoder is entitled to say. error.Unsupported => return, error.OutOfMemory => |e| return e, error.WriteFailed => return error.OutOfMemory, }; var back_reader: Io.Reader = .fixed(w.written()); var back = try z2dimg.decode(backing, &back_reader, .{ .limits = limits }); defer back.deinit(backing); try testing.expectEqual(sfc.getWidth(), back.getWidth()); try testing.expectEqual(sfc.getHeight(), back.getHeight()); try testing.expectEqual(sfc.getFormat(), back.getFormat()); // Opaque images survive exactly: twenty-four-bit BMP is lossless. // // Images with alpha survive to within two, and the two is not a fudge. A // surface holds premultiplied values; a BMP holds straight ones; so a // round trip is `multiply(demultiply(p))`, and z2d truncates both // divisions. Writing `r` for a premultiplied channel and `a` for the // alpha, what comes back is // // floor(floor(r * 255 / a) * a / 255) // // which is never more than `r` and never less than `r - 2`. Measuring it // in *straight* alpha instead would give a bound of the whole range, and // rightly: at an alpha of 2 a straight channel carries barely one bit of // real information, so 127 coming back as 0 is not drift, it is a number // that was never there. The premultiplied value is the one the file and // the surface both really represent, so that is where the claim belongs. const exact = switch (sfc.getFormat()) { .rgb, .xrgb => true, else => false, }; var y: i32 = 0; while (y < sfc.getHeight()) : (y += 1) { var x: i32 = 0; while (x < sfc.getWidth()) : (x += 1) { const a = channels(sfc.getPixel(x, y).?); const b = channels(back.getPixel(x, y).?); // The alpha itself is carried through untouched, always. try testing.expectEqual(a[3], b[3]); for (a[0..3], b[0..3]) |p, q| { if (exact) { try testing.expectEqual(p, q); } else if (q > p or p - q > 2) { std.debug.print( "premultiplied channel {d} became {d} at alpha {d}\n", .{ p, q, a[3] }, ); return error.ChannelDrifted; } } } } } /// A pixel's four channels exactly as the surface stores them: premultiplied, /// with no conversion in between. /// /// Deliberately not `Rgba8.fromZ2d`, which demultiplies. The whole point of /// the comparison above is to look at the values before that division throws /// anything away. fn channels(px: z2d.Pixel) [4]u8 { return switch (px) { .argb => |p| .{ p.r, p.g, p.b, p.a }, .rgba => |p| .{ p.r, p.g, p.b, p.a }, .xrgb => |p| .{ p.r, p.g, p.b, 255 }, .rgb => |p| .{ p.r, p.g, p.b, 255 }, .alpha8, .alpha4, .alpha2, .alpha1 => .{ 0, 0, 0, z2d.pixel.Alpha8.fromPixel(px).a }, }; } /// Playing anything, frame by frame. /// /// The properties are the still-image ones plus the two that only an /// animation can break: it has to *stop*, and every frame it hands out has to /// be inside the budget rather than only the first. A file declaring a /// thousand frames of a screen-sized picture is a few hundred bytes, which is /// the whole reason `max_frames` and `max_total_pixels` exist. fn animateProperty(input: []const u8) !void { // What the header promised, if it promised anything. Taken first, off a // reader of its own, so that it can be held against what playing the file // actually produces. var probe_reader: Io.Reader = .fixed(input); const promised: ?z2dimg.Info.Animation = if (z2dimg.probe(&probe_reader, limits)) |info| info.animation else |_| null; var reader: Io.Reader = .fixed(input); var frames = z2dimg.decodeAnimation(backing, &reader, .{ .limits = limits }) catch return; defer frames.deinit(backing); // Everything that comes out is written straight back, which is what the // still-image target does with `bmp.encode` and for the same reason: an // encoder that cannot write what the decoder just read is a hole between // the two, and nothing else here looks for one. The encoder is built on // the first frame, because the canvas size is not known before it. var written: std.ArrayList(u8) = .empty; defer written.deinit(backing); var out: Io.Writer.Allocating = .fromArrayList(backing, &written); defer written = out.toArrayList(); var encoder: ?z2dimg.AnimationEncoder = null; defer if (encoder) |*e| e.deinit(backing); var encoded_all = true; var complete = true; var seen: u32 = 0; while (frames.next(backing) catch blk: { // A decode that stopped part way proves nothing about a count, so // the claims below are made only about a file that played to the end. complete = false; break :blk null; }) |frame| { seen += 1; // It must terminate. The limits guarantee this and the assertion is // what says so out loud: a decoder that failed to advance would spin // here rather than in some caller's event loop. try testing.expect(seen <= limits.max_frames); try testing.expect(frame.surface.getWidth() >= 1); try testing.expect(frame.surface.getHeight() >= 1); try testing.expect(frame.surface.getWidth() <= limits.max_width); try testing.expect(frame.surface.getHeight() <= limits.max_height); // A frame is clipped to the canvas, so it can never be larger than // one --- which is the invariant that keeps a ten-byte frame header // from asking for memory `probe` never agreed to. if (frames.canvasSurface()) |canvas| { try testing.expect(frame.surface.getWidth() <= canvas.getWidth()); try testing.expect(frame.surface.getHeight() <= canvas.getHeight()); if (encoder == null and encoded_all) { encoder = z2dimg.encodeAnimation(&out.writer, .{ .gif = .{ .width = @intCast(canvas.getWidth()), .height = @intCast(canvas.getHeight()), } }) catch blk: { encoded_all = false; break :blk null; }; } } if (encoder) |*e| { e.frame(backing, frame) catch |err| switch (err) { // A frame this encoder will not write --- too many colours, // most often, since it does not quantise. Legitimate, and the // file is then half-written and not worth reading back. error.Unsupported => encoded_all = false, error.OutOfMemory => |x| return x, error.WriteFailed => return error.OutOfMemory, }; } } // And the canvas is an image the still-image side would have accepted. if (frames.canvasSurface()) |canvas| { try testing.expect(canvas.getWidth() <= limits.max_width); try testing.expect(canvas.getHeight() <= limits.max_height); } // What was written has to be readable, by this library at least. An // encoder emitting a file its own decoder refuses is the hole this looks // for, and it is only a fair question when the whole animation went out. if (encoder) |*e| { if (encoded_all and complete) { e.finish() catch { encoded_all = false; }; if (encoded_all) { out.writer.flush() catch return error.OutOfMemory; // `out.written()`, not `written.items`: the list was moved // into the writer and does not get it back until the defer // above runs. var back: Io.Reader = .fixed(out.written()); var again = try z2dimg.decodeAnimation(backing, &back, .{ .limits = limits }); defer again.deinit(backing); var round: u32 = 0; while (try again.next(backing)) |_| round += 1; try testing.expectEqual(seen, round); } } } // A probe a caller trusted and a decode that contradicted it would be // worse than a probe that said nothing, so the two are held together. if (complete) if (promised) |p| switch (p) { // "This does not animate" has to mean at most one frame comes out. .none => try testing.expect(seen <= 1), // "The header does not say" claims nothing, which is the point of // having it as a case of its own. .unknown => {}, // And a declared count has to be the count that arrived. The APNG // decoder checks this itself and refuses a file that disagrees, so // reaching the end with a different number would mean that check had // stopped working. .declared => |a| if (a.frames) |n| try testing.expectEqual(n, seen), }; } fn fuzzAnimate(_: void, smith: *Smith) !void { var buf: [content_max]u8 = undefined; try animateProperty(buf[0..smith.slice(&buf)]); } fn fuzzDecode(_: void, smith: *Smith) !void { var buf: [content_max]u8 = undefined; try decodeProperty(buf[0..smith.slice(&buf)]); } test "fuzz decode" { for (bmp_corpus) |seed| try decodeProperty(seed); try testing.fuzz({}, fuzzDecode, .{}); } test "fuzz animate" { // Every format, because anything is playable: a still image is an // animation of one frame, so this target exercises the whole table and // not only the animated corner of it. for (mixed_corpus) |seed| try animateProperty(seed); try testing.fuzz({}, fuzzAnimate, .{}); } // -- probing ----------------------------------------------------------------- /// Whatever `probe` says about an image, `decode` must produce. /// /// The two read the same header by the same code, so this is less about them /// disagreeing than about them being *allowed* to: a caller is invited to /// probe a stream, decide on the strength of the answer whether to go on, and /// then decode. That is only sound if the cheap answer binds the expensive one. fn probeProperty(input: []const u8) !void { var probe_reader: Io.Reader = .fixed(input); const info = z2dimg.probe(&probe_reader, limits) catch return; try testing.expect(info.width >= 1); try testing.expect(info.height >= 1); try testing.expect(info.pixelCount() <= limits.max_pixels); var decode_reader: Io.Reader = .fixed(input); var sfc = z2dimg.decode(backing, &decode_reader, .{ .limits = limits }) catch |err| switch (err) { // A header that probes cleanly and then runs out of pixel data is an // ordinary truncated file, not a disagreement. error.EndOfStream, error.InvalidData, error.Unsupported => return, else => return err, }; defer sfc.deinit(backing); try testing.expectEqual(@as(i32, @intCast(info.width)), sfc.getWidth()); try testing.expectEqual(@as(i32, @intCast(info.height)), sfc.getHeight()); try testing.expectEqual(info.surface_type, std.meta.activeTag(sfc)); } fn fuzzProbe(_: void, smith: *Smith) !void { var buf: [content_max]u8 = undefined; try probeProperty(buf[0..smith.slice(&buf)]); } test "fuzz probe" { for (bmp_corpus) |seed| try probeProperty(seed); try testing.fuzz({}, fuzzProbe, .{}); } // -- detection --------------------------------------------------------------- /// Detection is total: every byte string either names a format or does not, /// and it never consumes anything on the way to saying so. fn detectProperty(input: []const u8) !void { var reader: Io.Reader = .fixed(input); const before = reader.bufferedLen(); if (z2dimg.detectReader(&reader)) |fmt| { // Nothing consumed, whatever the answer. try testing.expectEqual(before, reader.bufferedLen()); // And the answer agrees with the slice-based form, which is what a // caller with the bytes already in hand would use. try testing.expectEqual(fmt, z2dimg.detect(input).?); } else |err| switch (err) { error.UnknownFormat => { try testing.expectEqual(before, reader.bufferedLen()); try testing.expectEqual(@as(?z2dimg.Format, null), z2dimg.detect(input)); }, error.BufferTooSmall, error.ReadFailed, error.EndOfStream => {}, } } fn fuzzDetect(_: void, smith: *Smith) !void { var buf: [64]u8 = undefined; try detectProperty(buf[0..smith.slice(&buf)]); } test "fuzz detect" { for (bmp_corpus) |seed| try detectProperty(seed); try testing.fuzz({}, fuzzDetect, .{}); } // -- encoding ---------------------------------------------------------------- /// A surface built out of fuzz bytes, written and read back. /// /// The other direction: the targets above start from a file and only reach the /// encoder through what the decoder accepted, so an encoder bug in a shape no /// BMP decodes to would never be reached. This starts from the surface. /// Progressive scan scripts to encode with, beyond the default. /// /// Both are complete and both cut the spectrum differently from the default /// and from each other, which is what exercises the coder: a band boundary /// decides where an end-of-block run can reach, and a refinement scan's /// correction bits are buffered across whatever the band leaves behind. const plain_script = [_]z2dimg.jpeg.Scan{ .{ .components = &.{ 0, 1, 2 }, .ss = 0, .se = 0, .ah = 0, .al = 0 }, .{ .components = &.{0}, .ss = 1, .se = 63, .ah = 0, .al = 0 }, .{ .components = &.{1}, .ss = 1, .se = 63, .ah = 0, .al = 0 }, .{ .components = &.{2}, .ss = 1, .se = 63, .ah = 0, .al = 0 }, }; const fine_script = [_]z2dimg.jpeg.Scan{ .{ .components = &.{ 0, 1, 2 }, .ss = 0, .se = 0, .ah = 0, .al = 2 }, .{ .components = &.{ 0, 1, 2 }, .ss = 0, .se = 0, .ah = 2, .al = 1 }, .{ .components = &.{ 0, 1, 2 }, .ss = 0, .se = 0, .ah = 1, .al = 0 }, .{ .components = &.{0}, .ss = 1, .se = 2, .ah = 0, .al = 0 }, .{ .components = &.{0}, .ss = 3, .se = 20, .ah = 0, .al = 0 }, .{ .components = &.{0}, .ss = 21, .se = 63, .ah = 0, .al = 1 }, .{ .components = &.{0}, .ss = 21, .se = 63, .ah = 1, .al = 0 }, .{ .components = &.{1}, .ss = 1, .se = 63, .ah = 0, .al = 0 }, .{ .components = &.{2}, .ss = 1, .se = 63, .ah = 0, .al = 0 }, }; const grey_plain_script = [_]z2dimg.jpeg.Scan{ .{ .components = &.{0}, .ss = 0, .se = 0, .ah = 0, .al = 0 }, .{ .components = &.{0}, .ss = 1, .se = 63, .ah = 0, .al = 0 }, }; fn encodeProperty(smith: *Smith) !void { // Small on purpose: the interesting dimensions are the ones where the row // padding is awkward, which is every width that is not a multiple of four. const width = smith.valueRangeAtMost(u8, 1, 17); const height = smith.valueRangeAtMost(u8, 1, 17); const with_alpha = smith.value(bool); // Which encoder to put it through. All three, because a surface shape // that upsets one of them — an odd width, a single row, a single pixel — // is exactly the sort of thing that upsets the others differently. const which = smith.valueRangeAtMost(u8, 0, 13); var sfc: z2d.Surface = try .init( if (with_alpha) .image_surface_rgba else .image_surface_rgb, backing, width, height, ); defer sfc.deinit(backing); var row: [17]z2dimg.pixels.Rgba8 = undefined; var y: i32 = 0; while (y < height) : (y += 1) { for (row[0..@intCast(width)]) |*px| { px.* = .{ .r = smith.value(u8), .g = smith.value(u8), .b = smith.value(u8), .a = if (with_alpha) smith.value(u8) else 255, }; } z2dimg.pixels.writeRow(&sfc, y, row[0..@intCast(width)]); } var list: std.ArrayList(u8) = .empty; defer list.deinit(backing); var w: Io.Writer.Allocating = .fromArrayList(backing, &list); defer list = w.toArrayList(); // Set by the Netpbm arms below, which are the only ones whose lossiness // depends on the options rather than on the format. var netpbm_lossy = false; const opts: z2dimg.EncodeOptions = switch (which) { 0 => .{ .bmp = .{} }, 1 => .{ .png = .{} }, 3 => .{ .xbm = .{ .name = "fuzzed", .threshold = smith.value(u8), } }, // The four Netpbm layouts. Each says for itself whether the pixels // survive the trip, since most of the ways of asking for one do not: // a bitmap is one bit, a greymap has no hue, a `maxval` that is not // 255 rescales, and any of them carrying alpha goes through the // premultiplied surface twice. 12 => blk: { // An icon of one image. The pixels survive, alpha included --- // a thirty-two bit entry is exactly what this writes. netpbm_lossy = false; break :blk .{ .ico = .{ .kind = if (smith.valueRangeAtMost(u8, 0, 1) == 1) .cursor else .icon, } }; }, 13 => blk: { // Lossless, and the only encoder here that writes straight alpha // rather than dropping it or flattening it --- so the round trip // below is exact for an opaque surface and within the // premultiplication slack for a transparent one, which is the // surface's arithmetic and not this codec's. netpbm_lossy = with_alpha; break :blk .{ .webp = .{ .lossless = .{ .subtract_green = smith.valueRangeAtMost(u8, 0, 1) == 1, } } }; }, 11 => blk: { // No shape loses a color it accepts, so the pixels survive --- // once alpha is out of the picture, which all but one shape // flattens. netpbm_lossy = with_alpha; // Every shape, asked for as a small integer for the reason the // JPEG arm below gives. The paletted ones refuse an image with // too many colors, which this target already expects; the ones // that keep what they are given are lossless for an opaque // surface, and `.rgba` keeps alpha within the premultiplication // slack besides. break :blk .{ .pcx = .{ .encoded = smith.valueRangeAtMost(u8, 0, 1) == 1, .shape = switch (smith.valueRangeAtMost(u8, 0, 6)) { 0 => .rgb, 1 => .rgba, 2 => .indexed_256, 3 => .planar_16, 4 => .packed_16, 5 => .packed_4, else => .auto, }, } }; }, 7 => blk: { netpbm_lossy = true; break :blk .{ .pbm = .{ .binary = smith.valueRangeAtMost(u8, 0, 1) == 1, .threshold = smith.value(u8), } }; }, 8 => blk: { netpbm_lossy = true; break :blk .{ .pgm = .{ .binary = smith.valueRangeAtMost(u8, 0, 1) == 1, // The whole range the format allows, since the extremes are // where the scaling arithmetic is most likely to go wrong. .max_value = smith.valueRangeAtMost(u16, 1, 65535), }, }; }, 9 => blk: { const max = smith.valueRangeAtMost(u16, 1, 65535); netpbm_lossy = with_alpha or max != 255; break :blk .{ .ppm = .{ .binary = smith.valueRangeAtMost(u8, 0, 1) == 1, .max_value = max, } }; }, 10 => blk: { const tuple: ?z2dimg.netpbm.Channels = switch (smith.valueRangeAtMost(u8, 0, 4)) { 0 => null, 1 => .grey, 2 => .grey_alpha, 3 => .rgb, else => .rgb_alpha, }; const max = smith.valueRangeAtMost(u16, 1, 65535); const colour = tuple == null or tuple == .rgb or tuple == .rgb_alpha; netpbm_lossy = with_alpha or max != 255 or !colour; break :blk .{ .pam = .{ .channels = tuple, .max_value = max } }; }, 6 => .{ .tga = .{ .rle = smith.valueRangeAtMost(u8, 0, 1) == 1, .top_down = smith.valueRangeAtMost(u8, 0, 1) == 1, }, }, 5 => .{ .gif = .{ // Low, so that the refusal an image with too many colours // gets is a path this target takes rather than one it never // reaches. .max_colours = smith.valueRangeAtMost(u32, 1, 64), }, }, 4 => .{ .xpm = .{ .name = "fuzzed", // Low, so that the refusal an image with too many colours gets is // a path this target takes rather than one it never reaches. .max_colours = smith.valueRangeAtMost(u32, 1, 64), }, }, // The JPEG encoder has more ways to spell the same image than the // other two put together, and the interesting ones are the paths a // fixed test would have to name: a progressive refinement scan's // correction bits, an end-of-block run broken by a restart marker, a // Huffman table measured from eleven pixels of noise. else => .{ .jpeg = .{ .quality = smith.valueRangeAtMost(u7, 1, 100), // Asked for as small integers rather than as enum values: a // `Smith` handed bytes it cannot fit into the range returns that // range's minimum rather than reducing into it, so a question // asked as an enum is answered with its first tag and no other. .chroma = switch (smith.valueRangeAtMost(u8, 0, 4)) { 0 => .full, 1 => .horizontal, 2 => .vertical, 3 => .half, // Factors from a range that runs past what the encoder // will write, so that the validation is fuzzed as well as // the arithmetic behind it. An invalid set comes back as // `error.Unsupported`, which this target already expects. else => .{ .factors = .{ .luma = .{ .h = smith.valueRangeAtMost(u32, 1, 5), .v = smith.valueRangeAtMost(u32, 1, 5), }, .cb = .{ .h = smith.valueRangeAtMost(u32, 1, 4), .v = smith.valueRangeAtMost(u32, 1, 4), }, .cr = .{ .h = smith.valueRangeAtMost(u32, 1, 4), .v = smith.valueRangeAtMost(u32, 1, 4), }, } }, }, .tables = if (smith.valueRangeAtMost(u8, 0, 1) == 0) .annex_k else .optimal, .mode = if (smith.valueRangeAtMost(u8, 0, 1) == 0) .baseline else .progressive, .restart_interval = smith.valueRangeAtMost(u16, 0, 4), .colour = switch (smith.valueRangeAtMost(u8, 0, 2)) { 0 => .auto, 1 => .greyscale, else => .ycbcr, }, // The default, one of the alternatives, or one that does // not fit the file being written --- which must come back as // `error.Unsupported` rather than as a file no decoder reads. .script = switch (smith.valueRangeAtMost(u8, 0, 3)) { 0 => null, 1 => &plain_script, 2 => &fine_script, else => &grey_plain_script, }, // The search is off most of the time, since it is the slow // path and the fuzzer's job is inputs per second --- but it // is a different quantiser and deserves its share of them. .orientation = switch (smith.valueRangeAtMost(u8, 0, 2)) { 0 => null, 1 => .top_left, else => .right_top, }, .trellis = smith.valueRangeAtMost(u8, 0, 3) == 0, .trellis_strength = switch (smith.valueRangeAtMost(u8, 0, 2)) { 0 => 0, 1 => z2dimg.jpeg.trellis.default_strength, else => 2.0, }, .quant = quant: { if (smith.valueRangeAtMost(u8, 0, 1) == 0) break :quant null; // Divisors from the whole range the format allows: the // extremes are where a quantiser is most likely to go // wrong, with every coefficient kept or every one crushed. var q: z2dimg.jpeg.Quant = .{ .luma = undefined, .chroma = undefined }; for (&q.luma) |*v| v.* = smith.valueRangeAtMost(u8, 1, 255); for (&q.chroma) |*v| v.* = smith.valueRangeAtMost(u8, 1, 255); break :quant q; }, }, }, }; z2dimg.encode(backing, &sfc, &w.writer, opts) catch |err| switch (err) { error.Unsupported => return, error.OutOfMemory => |e| return e, error.WriteFailed => return error.OutOfMemory, }; var reader: Io.Reader = .fixed(w.written()); var back = try z2dimg.decode(backing, &reader, .{ .limits = limits }); defer back.deinit(backing); try testing.expectEqual(sfc.getWidth(), back.getWidth()); try testing.expectEqual(sfc.getHeight(), back.getHeight()); // JPEG is lossy and has no alpha, and XBM is one bit a pixel, so for // neither do the pixels or the surface type come back; the dimensions // above are the whole claim for them. if (which == 2 or which == 3) return; if (netpbm_lossy) return; // XPM is lossless, but it writes straight alpha and drops the partial // kind, so a surface with any goes through a conversion the others do not. if ((which == 4 or which == 5) and with_alpha) return; try testing.expectEqual(sfc.getFormat(), back.getFormat()); if (!with_alpha) { // Twenty-four-bit BMP is lossless, so this is equality and not // approximation. Anything else means a row stride or a padding byte // is wrong, which is the bug this target exists to find. y = 0; while (y < height) : (y += 1) { var x: i32 = 0; while (x < width) : (x += 1) { try testing.expectEqual( sfc.getPixel(x, y).?.rgb, back.getPixel(x, y).?.rgb, ); } } } } fn fuzzEncode(_: void, smith: *Smith) !void { try encodeProperty(smith); } test "fuzz encode" { // Seeds that are just bytes: this target reads numbers rather than a // file, so a corpus of BMPs would say nothing to it. for ([_][]const u8{ "", &@as([64]u8, @splat('\x01')), &@as([64]u8, @splat('\xff')) }) |seed| { var smith: Smith = .{ .in = seed }; try encodeProperty(&smith); } try testing.fuzz({}, fuzzEncode, .{}); } // -- PNG --------------------------------------------------------------------- /// The same properties as `decodeProperty`, but through the PNG encoder, so /// that what a decode accepts must survive being written back out as a PNG. /// /// PNG is the harsher of the two round trips to make hold: it has five colour /// types and five bit depths in, and eight-bit truecolour out, so a decode /// that misreads a depth shows up here as pixels that do not come back. fn pngProperty(input: []const u8) !void { var reader: Io.Reader = .fixed(input); var sfc = z2dimg.decode(backing, &reader, .{ .limits = limits }) catch return; defer sfc.deinit(backing); var list: std.ArrayList(u8) = .empty; defer list.deinit(backing); var w: Io.Writer.Allocating = .fromArrayList(backing, &list); defer list = w.toArrayList(); z2dimg.encode(backing, &sfc, &w.writer, .{ .png = .{} }) catch |err| switch (err) { error.Unsupported => return, error.OutOfMemory => |e| return e, error.WriteFailed => return error.OutOfMemory, }; var back_reader: Io.Reader = .fixed(w.written()); var back = try z2dimg.decode(backing, &back_reader, .{ .limits = limits }); defer back.deinit(backing); try testing.expectEqual(sfc.getWidth(), back.getWidth()); try testing.expectEqual(sfc.getHeight(), back.getHeight()); try testing.expectEqual(sfc.getFormat(), back.getFormat()); var y: i32 = 0; while (y < sfc.getHeight()) : (y += 1) { var x: i32 = 0; while (x < sfc.getWidth()) : (x += 1) { const a = channels(sfc.getPixel(x, y).?); const b = channels(back.getPixel(x, y).?); try testing.expectEqual(a[3], b[3]); for (a[0..3], b[0..3]) |p, q| { if (q > p or p - q > 2) return error.ChannelDrifted; } } } } fn fuzzPng(_: void, smith: *Smith) !void { var buf: [content_max]u8 = undefined; try pngProperty(buf[0..smith.slice(&buf)]); } test "fuzz png" { for (png_corpus) |seed| try pngProperty(seed); try testing.fuzz({}, fuzzPng, .{}); } // -- JPEG -------------------------------------------------------------------- /// Whatever arrives, the decoder comes back, and what it produces is the size /// it said it would be. /// /// There is no round trip to check here yet, so the property is the weaker /// one: terminate, allocate within the limits, stay inside the planes, and /// agree with `probe`. That is still most of what matters — a JPEG decoder is /// several thousand lines of index arithmetic over attacker-supplied sampling /// factors, and the interesting failure is not a wrong pixel but a read /// outside a buffer. fn jpegProperty(input: []const u8) !void { var probe_reader: Io.Reader = .fixed(input); const info = z2dimg.probe(&probe_reader, limits) catch null; var reader: Io.Reader = .fixed(input); var sfc = z2dimg.decode(backing, &reader, .{ .limits = limits }) catch return; defer sfc.deinit(backing); try testing.expect(sfc.getWidth() >= 1); try testing.expect(sfc.getHeight() >= 1); try testing.expect(sfc.getWidth() <= limits.max_width); try testing.expect(sfc.getHeight() <= limits.max_height); // A header that probed cleanly binds the decode that follows it. if (info) |i| { if (i.format == .jpeg) { try testing.expectEqual(@as(i32, @intCast(i.width)), sfc.getWidth()); try testing.expectEqual(@as(i32, @intCast(i.height)), sfc.getHeight()); } } // Every pixel is readable and opaque: a JPEG carries no transparency, and // a decoder that left one untouched would show it. var y: i32 = 0; while (y < sfc.getHeight()) : (y += 1) { var x: i32 = 0; while (x < sfc.getWidth()) : (x += 1) { const px = sfc.getPixel(x, y) orelse return error.PixelMissing; try testing.expectEqual(@as(u8, 255), z2dimg.pixels.Rgba8.fromZ2d(px).a); } } // And whatever came out can be written back as a JPEG and read again. The // pixels are not compared — JPEG is lossy and a second pass through it // moves them — but the *shape* must survive, and an encoder handed an // image with an odd width or a single row is where that stops being true. var list: std.ArrayList(u8) = .empty; defer list.deinit(backing); var w: Io.Writer.Allocating = .fromArrayList(backing, &list); defer list = w.toArrayList(); z2dimg.encode(backing, &sfc, &w.writer, .{ .jpeg = .{} }) catch |err| switch (err) { error.Unsupported => return, error.OutOfMemory => |e| return e, error.WriteFailed => return error.OutOfMemory, }; var back_reader: Io.Reader = .fixed(w.written()); var back = try z2dimg.decode(backing, &back_reader, .{ .limits = limits }); defer back.deinit(backing); try testing.expectEqual(sfc.getWidth(), back.getWidth()); try testing.expectEqual(sfc.getHeight(), back.getHeight()); } fn fuzzJpeg(_: void, smith: *Smith) !void { var buf: [content_max]u8 = undefined; try jpegProperty(buf[0..smith.slice(&buf)]); } test "fuzz jpeg" { for (jpeg_corpus) |seed| try jpegProperty(seed); try testing.fuzz({}, fuzzJpeg, .{}); } // -- EXIF -------------------------------------------------------------------- /// Reading an EXIF block is total, and consumes exactly what it was told to. /// /// Metadata is the part of a file that no decoder validates and every decoder /// walks past, which makes it the part most worth pointing a fuzzer at. The /// two properties are the ones the codecs depend on: it never fails on a /// malformed block, because a broken `APP1` written by a camera in 2008 is no /// reason to refuse a perfectly good photograph; and it consumes the whole /// block whatever it finds, because the segment or chunk around it is framed /// by length and a reader left in the wrong place corrupts everything after. fn exifProperty(input: []const u8) !void { // Every prefix length the container could declare, up to the whole block. for ([_]usize{ 0, 1, input.len / 2, input.len }) |declared| { if (declared > input.len) continue; var r: Io.Reader = .fixed(input); const found = z2dimg.exif.readOrientation(&r, @intCast(declared)) catch |err| switch (err) { // Only the stream may fail, and a fixed one cannot; a block that // ends inside itself is answered rather than raised. error.ReadFailed, error.EndOfStream => return error.ExifShouldNotFail, }; // Exactly the declared length is consumed, whatever was found. The // segment or chunk around an EXIF block is framed by length, so a // reader left anywhere else corrupts everything after it. try testing.expectEqual(input.len - declared, r.bufferedLen()); if (found) |o| { const n = @backingInt(o); try testing.expect(n >= 1 and n <= 8); // The two views of an orientation agree: the four that swap the // dimensions are exactly the four that involve a quarter turn. const turns = o.transform().rotate; try testing.expectEqual( o.swapsDimensions(), turns == .clockwise or turns == .anticlockwise, ); } } // And a block the container declared longer than the stream actually has // is a truncated *file*, which is the one thing that may be raised. var short: Io.Reader = .fixed(input); _ = z2dimg.exif.readOrientation(&short, @intCast(input.len + 1)) catch |err| switch (err) { error.EndOfStream => return, error.ReadFailed => return error.ExifShouldNotFail, }; return error.ExifShouldHaveRunOut; } fn fuzzExif(_: void, smith: *Smith) !void { var buf: [content_max]u8 = undefined; try exifProperty(buf[0..smith.slice(&buf)]); } test "fuzz exif" { for (exif_corpus) |seed| try exifProperty(seed); try testing.fuzz({}, fuzzExif, .{}); } // -- ICC --------------------------------------------------------------------- /// Reassembling a profile from pieces is total, bounded, and never hands back /// something that is not a profile. /// /// The pieces of a JPEG's profile are length-prefixed segments an attacker /// writes, and what they claim about each other --- which piece this is, how /// many there are --- is checked against nothing else in the file. So the /// three properties that matter are that it always terminates, that it never /// exceeds the caller's budget however the pieces are numbered, and that a /// profile that came back is one, since it is about to be written into /// somebody else's file. fn iccProperty(input: []const u8) !void { const limit = 4096; var out: std.ArrayList(u8) = .empty; defer out.deinit(backing); var assembler: z2dimg.icc.Assembler = .{}; // The input cut into pieces at a length the input itself chooses, which // is how a malformed file's segments arrive. var at: usize = 0; while (at < input.len) { const take = @max(1, @as(usize, input[at]) + 1); const end = @min(at + take, input.len); _ = try assembler.take(backing, &out, input[at..end], limit); at = end; } assembler.finish(&out); try testing.expect(out.items.len <= limit); if (out.items.len != 0) { try testing.expect(z2dimg.icc.looksValid(out.items)); } } fn fuzzIcc(_: void, smith: *Smith) !void { var buf: [content_max]u8 = undefined; try iccProperty(buf[0..smith.slice(&buf)]); } test "fuzz icc" { for (icc_corpus) |seed| try iccProperty(seed); try testing.fuzz({}, fuzzIcc, .{}); } // -- the table --------------------------------------------------------------- /// Wraps one of the `fuzz*` functions above so that it takes raw bytes, which /// is what `tools/fuzz.zig` has to hand. fn Driven(comptime one: fn (void, *Smith) anyerror!void) type { return struct { fn run(input: []const u8) anyerror!void { var smith: Smith = .{ .in = input }; return one({}, &smith); } }; } pub const all = [_]Target{ .{ .name = "exif", .run = Driven(fuzzExif).run, .corpus = &exif_corpus, .content_max = content_max }, .{ .name = "icc", .run = Driven(fuzzIcc).run, .corpus = &icc_corpus, .content_max = content_max }, .{ .name = "decode", .run = Driven(fuzzDecode).run, .corpus = &mixed_corpus, .content_max = content_max, .repair = repairPng }, .{ .name = "probe", .run = Driven(fuzzProbe).run, .corpus = &mixed_corpus, .content_max = content_max, .repair = repairPng }, .{ .name = "animate", .run = Driven(fuzzAnimate).run, .corpus = &mixed_corpus, .content_max = content_max, .repair = repairPng }, .{ .name = "png", .run = Driven(fuzzPng).run, .corpus = &png_corpus, .content_max = content_max, .repair = repairPng, .interesting = png_interesting }, .{ .name = "jpeg", .run = Driven(fuzzJpeg).run, .corpus = &jpeg_corpus, .content_max = content_max, .interesting = jpeg_interesting }, // This target's buffer is the smaller one, and a length past it would be // answered with nothing at all. .{ .name = "detect", .run = Driven(fuzzDetect).run, .corpus = &mixed_corpus, .content_max = 64 }, // No corpus: this one reads numbers rather than a file, so an image would // say nothing to it. .{ .name = "encode", .run = Driven(fuzzEncode).run, .corpus = &.{}, .content_max = 256 }, };