Commits
Commits on
5591c0e1dfbc7e0137f2c8d4fb224bfcb05d01baFiltered to crates/ec-image/src/webp/mod.rsClear filter2026-08-26
fix(image): budget every header-declared allocation; bound LZW growthAhmet Kaan Gümüş · 81c7624
fix(image): budget every header-declared allocation; bound LZW growth Both 2026-08-26 machine OOMs were crates/ec-image tests/fuzz: decoders allocated from wire-declared fields with no budget. Class fix: - Limits::check_bytes + AllocBudget: per-buffer cap lowered to 1 GiB, decode-wide total of 4 GiB; GIF/WebP animation paths spend the budget per frame, closing the frame_count x canvas multiplier. - GIF frame rectangles get their own limits check (they need not fit the canvas the screen descriptor bounded). - lzw_decode stops once the declared frame is full instead of expanding a bomb stream to ~400 MB from a 155 KB input. - HEVC slice headers reject num_ref_idx_lX_active_minus1 > 14 (7.4.7.1) before pred_weight_table sizes vectors from it. Fuzz suite holds under a 4G scope (max RSS 3.1G, was 27G); differential and real-library suites stay green.
feat(image): animated WebP, composited frame by frameAhmet Kaan Gümüş · 275d306
feat(image): animated WebP, composited frame by frame decode_frames walks the ANMF chunks and composites them onto the canvas: frame rectangles, both blending methods, and dispose-to-background applied before the next frame is drawn. is_animated answers from the container alone. The still and animated paths now share one payload decoder. The incumbent decoder ignores the dispose-to-background flag, so it cannot be the oracle for the frame after a disposal: that fixture is gated against libwebp's own composited frames instead, pixel-exact, and the incumbent remains the oracle for the opaque fixture. ffmpeg refuses animated WebP outright and cannot arbitrate. Adds a lossless fixture whose three frames carry alpha and exercise both blending methods and the disposal rectangle -- the existing animation is opaque and disposes nothing.
2026-08-14
feat(image): WebP decoding, VP8 key frames and VP8LAhmet Kaan Gümüş · 22ac6ab
feat(image): WebP decoding, VP8 key frames and VP8L The RIFF container, both bitstreams, and the separate alpha plane an extended file carries. VP8 (RFC 6386) is a complete key frame decoder: boolean entropy decoder, segmentation, per-partition token decoding with the neighbour contexts, the WHT and DCT inversions bit-exactly as specified, all sixteen intra prediction modes including the six diagonal subblock ones, and both loop filters with their per-macroblock strength derivation. The probability and quantizer tables are generated from the RFC text rather than retyped — two thousand values transcribed by hand is a defect waiting to be found several macroblocks into a picture. VP8L is the lossless bitstream: canonical prefix codes with meta prefix groups, the colour cache, LZ77 over the two-dimensional distance map, and all four transforms applied in the reverse of the order they were read. The colour cache size is read *before* the meta prefix codes; the other order parses plausibly and then fails on the first real file. Alpha arrives either raw or as a headerless lossless stream in the green channel, then unfiltered by the method its chunk declares. Animation is refused by name: a still decoder that quietly returns frame one makes "this plays" and "this decoded" indistinguishable to its caller.