Skip to content

Commit

Permalink
jxl-oxide: Fix panic while decoding fully loaded intermediate frame (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
tirr-c authored Sep 15, 2024
1 parent 839e7b6 commit 9978f74
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion crates/jxl-oxide/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,11 @@ impl JxlImage {
.ctx
.image_region()
.apply_orientation(&self.image_header);
let frame = self.ctx.current_loading_frame().unwrap();
let frame = self
.ctx
.frame(self.ctx.loaded_frames())
.or_else(|| self.ctx.frame(self.ctx.loaded_frames() - 1))
.unwrap();
let frame_header = frame.header();
let target_frame_region = image_region.translate(-frame_header.x0, -frame_header.y0);

Expand Down

0 comments on commit 9978f74

Please sign in to comment.