Footage cache (#3271): review fixes

- A covered batch is served before a remembered failure; failures are kept per request, so a
  broken part or too many channels never hides the picture; a picture too large with its
  effects' channels is read alone.
- Hostile headers: parts whose data window or uncompressed block is out of bounds are refused
  before any decoder sees them (index, reader and the image crate's whole-file path, import).
- Seek and read errors are transient (Stopped), not remembered; the copy path notes its file.
- The index drops the headers' other attributes and previews, is bounded by bytes and checks
  the file's identity before it is reused.
- A picture read alone isn't kept twice (plane store and frame cache).
- A waiter whose decodes keep being called off decodes a copy; rounds are bounded.
- The Cryptomatte probe asks with its own effect's need; animated parameters are found in
  nested groups.
- Test hooks and caps are keyed by path; new tests: data window offsets, failures per request,
  too large with channels, the file bound, hostile data windows, damaged files, rows and levels
  on every compression and on tiles.
This commit is contained in:
vangel76 committed 2026-11-08 02:43:58 +01:00
1 parent 63d32fa33e
commit bf48ec8b8e
14 files changed
+636 -174

No files matched your search

+7 -2
View File
@@ -220,13 +220,18 @@ impl<'a> Renderer<'a> {
/// OpenEXR footage's at the layer's source time (Time Remap included), or a precomp's
/// generated 3D channels at its nested time. `None` for other layers.
pub fn layer_aux(&self, ctx: &EvalCtx, layer: &Layer) -> Option<Arc<effectcraft_raster::AuxChannels>> {
self.layer_aux_with(ctx, layer, &self.layer_aux_need(ctx, layer))
}
/// [`Renderer::layer_aux`] of what `need` reads (a footage layer's channels; a precomp's
/// generated channels are all made anyway).
pub fn layer_aux_with(&self, ctx: &EvalCtx, layer: &Layer, need: &effectcraft_raster::channels3d::AuxNeed) -> Option<Arc<effectcraft_raster::AuxChannels>> {
match &layer.source {
LayerSource::Footage { item } => {
let item = ctx.media_item(layer, *item);
let ItemKind::Footage(f) = &self.project.item(item)?.kind else { return None };
// Only what the layer's effects read (#3271).
let need = self.layer_aux_need(ctx, layer);
let a = self.read(|| self.footage.aux_for(item, f, ctx.source_time(layer), &need))?;
let a = self.read(|| self.footage.aux_for(item, f, ctx.source_time(layer), need))?;
// Aux pixels per layer pixel (the layer is the footage at its nominal size). The
// planes are only copied when that changes the scale.
let scale = a.width as f64 / f.width as f64;
+14 -2
View File
@@ -52,7 +52,13 @@ pub trait FootageSource: Send + Sync {
/// [`FootageSource::aux`] of only what `need` reads (#3271): the channels its lookups find,
/// or more (sources may hand over a set that holds them; [`effectcraft_raster::AuxChannels::listed`]
/// then names every channel). Sources that read every channel anyway can leave the default.
fn aux_for(&self, item: ItemId, footage: &Footage, t: Tick, need: &effectcraft_raster::channels3d::AuxNeed) -> Option<Arc<effectcraft_raster::AuxChannels>> {
fn aux_for(
&self,
item: ItemId,
footage: &Footage,
t: Tick,
need: &effectcraft_raster::channels3d::AuxNeed,
) -> Option<Arc<effectcraft_raster::AuxChannels>> {
let _ = need;
self.aux(item, footage, t)
}
@@ -191,7 +197,13 @@ impl FootageSource for CancellableFootage<'_> {
fn aux(&self, item: ItemId, footage: &Footage, t: Tick) -> Option<Arc<effectcraft_raster::AuxChannels>> {
self.inner.aux(item, footage, t)
}
fn aux_for(&self, item: ItemId, footage: &Footage, t: Tick, need: &effectcraft_raster::channels3d::AuxNeed) -> Option<Arc<effectcraft_raster::AuxChannels>> {
fn aux_for(
&self,
item: ItemId,
footage: &Footage,
t: Tick,
need: &effectcraft_raster::channels3d::AuxNeed,
) -> Option<Arc<effectcraft_raster::AuxChannels>> {
self.inner.aux_for(item, footage, t, need)
}
fn aux_names(&self, item: ItemId, footage: &Footage, t: Tick) -> Option<Arc<effectcraft_raster::AuxChannels>> {