Files
photocraft/crates/codecs/fuzz/fuzz_targets/decode_webp.rs
T
lloydandClaude Opus 5.5 54e7287ba6 Animated WebP: every frame loads into video layers (#1198)
An animated WebP used to bring only its first frame into a video layer. Now
New Video Layer from File, Replace Footage, Reload Frame and Video Frames to
Layers take every frame, as they do for an animated GIF (#572):

- photocraft-codecs: `decode_webp_frames` returns each frame composited onto
  the canvas by image-webp (offsets, blending, disposal), with its duration in
  milliseconds and the file's ICC profile. A still WebP is one frame, read as
  `decode` reads it. A damaged later frame keeps the frames before it and marks
  the first `Truncated`; the frame count and total bytes are checked against
  `Limits`. `webp_is_animated` tells the two apart. New `decode_webp` fuzz
  target.
- photocraft-io: `import_webp_frames`, sharing `import_gif_frames`' loop.
- photocraft-engine: `load_frames` takes an animated WebP's frames; the
  timeline rate comes from the most common duration. A still WebP keeps the
  existing path and the 30 fps default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 19:24:07 +02:00

14 lines
443 B
Rust

#![no_main]
use libfuzzer_sys::fuzz_target;
use photocraft_codecs::{decode_as_with, decode_webp_frames, DecodeOptions, Format, Limits};
fuzz_target!(|data: &[u8]| {
let opts = DecodeOptions {
limits: Limits { max_width: 4096, max_height: 4096, max_pixels: 1 << 22, max_alloc: 256 << 20 },
..Default::default()
};
let _ = decode_as_with(Format::WebP, data, &opts);
let _ = decode_webp_frames(data, &opts);
});