Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package openjph for openSUSE:Factory checked in at 2026-05-08 16:42:22 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/openjph (Old) and /work/SRC/openSUSE:Factory/.openjph.new.1966 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "openjph" Fri May 8 16:42:22 2026 rev:19 rq:1351343 version:0.27.1 Changes: -------- --- /work/SRC/openSUSE:Factory/openjph/openjph.changes 2026-04-15 16:04:28.506763351 +0200 +++ /work/SRC/openSUSE:Factory/.openjph.new.1966/openjph.changes 2026-05-08 16:42:24.401786946 +0200 @@ -1,0 +2,7 @@ +Thu May 7 05:44:29 UTC 2026 - Michael Vetter <[email protected]> + +- Update to 0.27.1: + * Adds a check that we do not use reversible Sqcd/Sqcc with irreversible transform + * Detecting illegal precinct width or height #269 + +------------------------------------------------------------------- Old: ---- 0.27.0.tar.gz New: ---- 0.27.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ openjph.spec ++++++ --- /var/tmp/diff_new_pack.mCZrfR/_old 2026-05-08 16:42:25.121816783 +0200 +++ /var/tmp/diff_new_pack.mCZrfR/_new 2026-05-08 16:42:25.129817114 +0200 @@ -17,7 +17,7 @@ Name: openjph -Version: 0.27.0 +Version: 0.27.1 Release: 0 Summary: An implementation of JPEG2000 Part-15 License: BSD-2-Clause ++++++ 0.27.0.tar.gz -> 0.27.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OpenJPH-0.27.0/src/core/codestream/ojph_params.cpp new/OpenJPH-0.27.1/src/core/codestream/ojph_params.cpp --- old/OpenJPH-0.27.0/src/core/codestream/ojph_params.cpp 2026-04-14 01:35:14.000000000 +0200 +++ new/OpenJPH-0.27.1/src/core/codestream/ojph_params.cpp 2026-05-07 05:33:32.000000000 +0200 @@ -992,10 +992,21 @@ OJPH_ERROR(0x0005007E, "unsupported settings in a COD-SPcod parameter"); ui8 num_decompositions = get_num_decompositions(); - if (Scod & 1) - for (int i = 0; i <= num_decompositions; ++i) + if (Scod & 1) { + for (int i = 0; i <= num_decompositions; ++i) { if (file->read(&SPcod.precinct_size[i], 1) != 1) OJPH_ERROR(0x0005007B, "error reading COD segment"); + if (i) + if ((SPcod.precinct_size[i] & 0x0F) == 0 || + (SPcod.precinct_size[i] >> 4) == 0) + OJPH_ERROR(0x0005007F, + "Precinct width or height for resolutions other than the" + " coarsest must be larger than 1; here, they are %d and %d," + " respectively.", + 1 << (SPcod.precinct_size[i] & 0x0F), + 1 << (SPcod.precinct_size[i] >> 4)); + } + } if (Lcod != 12 + ((Scod & 1) ? 1 + SPcod.num_decomp : 0)) OJPH_ERROR(0x0005007C, "error in COD segment length"); } @@ -1051,10 +1062,21 @@ OJPH_ERROR(0x0005012D, "unsupported settings in a COC-SPcoc parameter"); ui8 num_decompositions = get_num_decompositions(); - if (Scod & 1) - for (int i = 0; i <= num_decompositions; ++i) + if (Scod & 1) { + for (int i = 0; i <= num_decompositions; ++i) { if (file->read(&SPcod.precinct_size[i], 1) != 1) OJPH_ERROR(0x0005012A, "error reading COC segment"); + if (i) + if ((SPcod.precinct_size[i] & 0x0F) == 0 || + (SPcod.precinct_size[i] >> 4) == 0) + OJPH_ERROR(0x0005012E, + "Precinct width or height for resolutions other than the" + " coarsest must be larger than 1; here, they are %d and %d," + " respectively.", + 1 << (SPcod.precinct_size[i] & 0x0F), + 1 << (SPcod.precinct_size[i] >> 4)); + } + } ui32 t = 9; t += num_comps < 257 ? 0 : 1; t += (Scod & 1) ? 1 + num_decompositions : 0; @@ -1399,11 +1421,15 @@ ////////////////////////////////////////////////////////////////////////// float param_qcd::get_irrev_delta(const param_dfs* dfs, - ui32 num_decompositions, + ui32 num_decompositions, ui32 comp_num, ui32 resolution, ui32 subband) const { float arr[] = { 1.0f, 2.0f, 2.0f, 4.0f }; - assert((Sqcd & 0x1F) == 2); + if ((Sqcd & 0x1F) != 2) + OJPH_ERROR(0x00050101, "There is something wrong in the configuration " + "of the codestream; for component %d, the codestream defines an " + "irreversible transform, for which the codestream provides a " + "reversible (no quantization) step sizes in Sqcd/Sqcc.", comp_num); ui32 idx; if (dfs != NULL && dfs->exists()) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OpenJPH-0.27.0/src/core/codestream/ojph_params_local.h new/OpenJPH-0.27.1/src/core/codestream/ojph_params_local.h --- old/OpenJPH-0.27.0/src/core/codestream/ojph_params_local.h 2026-04-14 01:35:14.000000000 +0200 +++ new/OpenJPH-0.27.1/src/core/codestream/ojph_params_local.h 2026-05-07 05:33:32.000000000 +0200 @@ -715,7 +715,7 @@ ui32 resolution, ui32 subband) const; ui32 propose_precision(const param_cod* cod) const; float get_irrev_delta(const param_dfs* dfs, - ui32 num_decompositions, + ui32 num_decompositions, ui32 comp_num, ui32 resolution, ui32 subband) const; bool write(outfile_base *file); bool write_qcc(outfile_base *file, ui32 num_comps); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OpenJPH-0.27.0/src/core/codestream/ojph_resolution.cpp new/OpenJPH-0.27.1/src/core/codestream/ojph_resolution.cpp --- old/OpenJPH-0.27.0/src/core/codestream/ojph_resolution.cpp 2026-04-14 01:35:14.000000000 +0200 +++ new/OpenJPH-0.27.1/src/core/codestream/ojph_resolution.cpp 2026-05-07 05:33:32.000000000 +0200 @@ -2,21 +2,21 @@ // This software is released under the 2-Clause BSD license, included // below. // -// Copyright (c) 2019, Aous Naman +// Copyright (c) 2019, Aous Naman // Copyright (c) 2019, Kakadu Software Pty Ltd, Australia // Copyright (c) 2019, The University of New South Wales, Australia -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: -// +// // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. -// +// // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. -// +// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS // IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A @@ -57,7 +57,7 @@ { ////////////////////////////////////////////////////////////////////////// void resolution::pre_alloc(codestream* codestream, const rect& res_rect, - const rect& recon_res_rect, + const rect& recon_res_rect, ui32 comp_num, ui32 res_num) { mem_fixed_allocator* allocator = codestream->get_allocator(); @@ -150,7 +150,7 @@ tby1 = try1 >> 1; re.org.y = tby0; re.siz.h = tby1 - tby0; - subband::pre_alloc(codestream, re, comp_num, res_num, + subband::pre_alloc(codestream, re, comp_num, res_num, transform_flags); } else if (ds == param_dfs::HORZ_DWT) @@ -170,7 +170,7 @@ tbx1 = trx1 >> 1; re.org.x = tbx0; re.siz.w = tbx1 - tbx0; - subband::pre_alloc(codestream, re, comp_num, res_num, + subband::pre_alloc(codestream, re, comp_num, res_num, transform_flags); } else @@ -183,7 +183,7 @@ } } else - subband::pre_alloc(codestream, res_rect, comp_num, res_num, + subband::pre_alloc(codestream, res_rect, comp_num, res_num, transform_flags); //prealloc precincts @@ -219,7 +219,7 @@ allocator->pre_alloc_data<si32>(width, 1); allocator->pre_alloc_data<si32>(width, 1); } - else + else { for (ui32 i = 0; i < num_steps; ++i) allocator->pre_alloc_data<si64>(width, 1); @@ -328,7 +328,7 @@ child_res = allocator->post_alloc_obj<resolution>(1); child_res->finalize_alloc(codestream, re, skipped_res_for_recon ? recon_res_rect : re, comp_num, - res_num - 1, comp_downsamp, next_res_downsamp, + res_num - 1, comp_downsamp, next_res_downsamp, parent_tile_comp, this); } else @@ -407,7 +407,7 @@ num_precincts.w -= trx0 >> log_PP.w; num_precincts.h = (try1 + (1 << log_PP.h) - 1) >> log_PP.h; num_precincts.h -= try0 >> log_PP.h; - precincts = + precincts = allocator->post_alloc_obj<precinct>((size_t)num_precincts.area()); ui64 num = num_precincts.area(); for (ui64 i = 0; i < num; ++i) @@ -508,7 +508,7 @@ allocator->post_alloc_data<si64>(width, 1), width, 1); } } - else + else { for (ui32 i = 0; i < num_steps; ++i) ssp[i].line->wrap( @@ -528,7 +528,7 @@ ////////////////////////////////////////////////////////////////////////// line_buf* resolution::get_line() - { + { if (vert_even) { ++cur_line; @@ -742,11 +742,11 @@ { if (vert_even) { // even if (transform_flags & HORZ_TRX) - rev_horz_syn(atk, aug->line, child_res->pull_line(), + rev_horz_syn(atk, aug->line, child_res->pull_line(), bands[1].pull_line(), width, horz_even); else memcpy(aug->line->p, child_res->pull_line()->p, - (size_t)width + (size_t)width * (aug->line->flags & line_buf::LFT_SIZE_MASK)); aug->active = true; vert_even = !vert_even; @@ -755,11 +755,11 @@ } else { if (transform_flags & HORZ_TRX) - rev_horz_syn(atk, sig->line, bands[2].pull_line(), + rev_horz_syn(atk, sig->line, bands[2].pull_line(), bands[3].pull_line(), width, horz_even); else memcpy(sig->line->p, bands[2].pull_line()->p, - (size_t)width + (size_t)width * (sig->line->flags & line_buf::LFT_SIZE_MASK)); sig->active = true; vert_even = !vert_even; @@ -799,7 +799,7 @@ bands[1].pull_line(), width, horz_even); else memcpy(aug->line->p, child_res->pull_line()->p, - (size_t)width + (size_t)width * (aug->line->flags & line_buf::LFT_SIZE_MASK)); } else @@ -809,11 +809,11 @@ bands[3].pull_line(), width, horz_even); else memcpy(aug->line->p, bands[2].pull_line()->p, - (size_t)width + (size_t)width * (aug->line->flags & line_buf::LFT_SIZE_MASK)); if (aug->line->flags & line_buf::LFT_32BIT) { - si32* sp = aug->line->i32; + si32* sp = aug->line->i32; for (ui32 i = width; i > 0; --i) *sp++ >>= 1; } @@ -843,9 +843,9 @@ { if (vert_even) { // even if (transform_flags & HORZ_TRX) - irv_horz_syn(atk, aug->line, child_res->pull_line(), + irv_horz_syn(atk, aug->line, child_res->pull_line(), bands[1].pull_line(), width, horz_even); - else + else memcpy(aug->line->f32, child_res->pull_line()->f32, width * sizeof(float)); aug->active = true; @@ -859,7 +859,7 @@ } else { if (transform_flags & HORZ_TRX) - irv_horz_syn(atk, sig->line, bands[2].pull_line(), + irv_horz_syn(atk, sig->line, bands[2].pull_line(), bands[3].pull_line(), width, horz_even); else memcpy(sig->line->f32, bands[2].pull_line()->f32, @@ -924,7 +924,7 @@ } } else - { + { if (reversible) { if (transform_flags & HORZ_TRX) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OpenJPH-0.27.0/src/core/codestream/ojph_subband.cpp new/OpenJPH-0.27.1/src/core/codestream/ojph_subband.cpp --- old/OpenJPH-0.27.0/src/core/codestream/ojph_subband.cpp 2026-04-14 01:35:14.000000000 +0200 +++ new/OpenJPH-0.27.1/src/core/codestream/ojph_subband.cpp 2026-05-07 05:33:32.000000000 +0200 @@ -3,21 +3,21 @@ // This software is released under the 2-Clause BSD license, included // below. // -// Copyright (c) 2019, Aous Naman +// Copyright (c) 2019, Aous Naman // Copyright (c) 2019, Kakadu Software Pty Ltd, Australia // Copyright (c) 2019, The University of New South Wales, Australia -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: -// +// // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. -// +// // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. -// +// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS // IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A @@ -127,7 +127,8 @@ this->band_rect = band_rect; this->parent = res; - const param_cod* cdp = codestream->get_coc(parent->get_comp_num()); + ui32 comp_num = parent->get_comp_num(); + const param_cod* cdp = codestream->get_coc(comp_num); this->reversible = cdp->access_atk()->is_reversible(); size log_cb = cdp->get_log_block_dims(); log_PP = cdp->get_log_precinct_size(res_num); @@ -149,14 +150,14 @@ if (dfs != NULL) dfs = dfs->get_dfs(cdp->get_dfs_index()); } - ui32 comp_num = parent->get_comp_num(); const param_qcd* qcd = codestream->access_qcd()->get_qcc(comp_num); ui32 num_decomps = cdp->get_num_decompositions(); this->K_max = qcd->get_Kmax(dfs, num_decomps, this->res_num, band_num); if (!reversible) { - float d = - qcd->get_irrev_delta(dfs, num_decomps, res_num, subband_num); + float d = + qcd->get_irrev_delta(dfs, num_decomps, + comp_num, res_num, subband_num); d /= (float)(1u << (31 - this->K_max)); delta = d; delta_inv = (1.0f/d); @@ -199,7 +200,7 @@ ui32 cbx1 = ojph_min(tbx1, x_lower_bound + (i + 1) * nominal.w); cb_size.w = cbx1 - cbx0; blocks[i].finalize_alloc(codestream, this, nominal, cb_size, - coded_cbs + i, K_max, line_offset, + coded_cbs + i, K_max, line_offset, precision, comp_num); line_offset += cb_size.w; } @@ -210,7 +211,7 @@ ui32 width = band_rect.siz.w + 1; if (reversible) { - if (precision <= 32) + if (precision <= 32) lines->wrap(allocator->post_alloc_data<si32>(width, 1), width, 1); else lines->wrap(allocator->post_alloc_data<si64>(width, 1), width, 1);
