From 3c3bb0c6ba5acdd0023f428b82523089f37719d6 Mon Sep 17 00:00:00 2001 From: Aous Naman Date: Tue, 6 Feb 2024 08:18:27 +1100 Subject: [PATCH] This fixes the bug when a resolution has only two rows. --- src/core/codestream/ojph_resolution.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/codestream/ojph_resolution.cpp b/src/core/codestream/ojph_resolution.cpp index ff0b081..82371bd 100644 --- a/src/core/codestream/ojph_resolution.cpp +++ b/src/core/codestream/ojph_resolution.cpp @@ -553,8 +553,10 @@ namespace ojph { bands[1].push_line(); child_res->push_line(); } - irrev_vert_wvlt_K(lines + 2, lines + 5, - false, width); + if (cur_line >= 2) + irrev_vert_wvlt_K(lines + 2, lines + 5, false, width); + else + irrev_vert_wvlt_K(lines, lines + 5, false, width); irrev_horz_wvlt_fwd_tx(lines + 5, bands[2].get_line(), bands[3].get_line(), width, horz_even); bands[2].push_line();