From 4343291e8972c3d860a864186ea8a533e9a566ed Mon Sep 17 00:00:00 2001 From: David Michael Barr Date: Mon, 16 Oct 2023 22:35:05 +0900 Subject: [PATCH] Fix assertion against entering lossless mode When skipping, we may ignore the quantizer value. Fixes #3209. --- src/encoder.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/encoder.rs b/src/encoder.rs index a3ee7e32e8..bfed8ff55d 100644 --- a/src/encoder.rs +++ b/src/encoder.rs @@ -2239,7 +2239,11 @@ pub fn write_tx_blocks( let bw = bsize.width_mi() / tx_size.width_mi(); let bh = bsize.height_mi() / tx_size.height_mi(); let qidx = get_qidx(fi, ts, cw, tile_bo); - assert_ne!(qidx, 0); // lossless is not yet supported + + // TODO: Lossless is not yet supported. + if !skip { + assert_ne!(qidx, 0); + } let PlaneConfig { xdec, ydec, .. } = ts.input.planes[1].cfg; // SAFETY: We write to the array below before reading from it.