From 88bb1c6d06112a09ee0179ef732ac6a8b2317130 Mon Sep 17 00:00:00 2001 From: Aous Naman Date: Fri, 18 Feb 2022 10:41:43 +1100 Subject: [PATCH] A small fix for the limits on U_q. It cannot be larger than missing_msbs + 2, instead of missing_msbs + 1. --- src/core/coding/ojph_block_decoder.cpp | 8 ++++---- src/core/common/ojph_version.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core/coding/ojph_block_decoder.cpp b/src/core/coding/ojph_block_decoder.cpp index 869efc5..935a4d1 100644 --- a/src/core/coding/ojph_block_decoder.cpp +++ b/src/core/coding/ojph_block_decoder.cpp @@ -1258,10 +1258,10 @@ namespace ojph { } //decode uvlc_mode to get u for both quads ui32 consumed_bits = decode_init_uvlc(vlc_val, uvlc_mode, U_q); - if (U_q[0] > missing_msbs + 1 || U_q[1] > missing_msbs + 1) + if (U_q[0] > missing_msbs + 2 || U_q[1] > missing_msbs + 2) { OJPH_WARN(0x00010007, "Malformed codeblock bitstream. Uq is larger " - "than missing_msbs + 1.\n"); + "than missing_msbs + 2.\n"); return false; } @@ -1537,10 +1537,10 @@ namespace ojph { U_q[1] += E > 2 ? E - 2 : 0; } - if (U_q[0] > missing_msbs + 1 || U_q[1] > missing_msbs + 1) + if (U_q[0] > missing_msbs + 2 || U_q[1] > missing_msbs + 2) { OJPH_WARN(0x00010007, "Malformed codeblock bitstream. Uq is " - "larger than missing_msbs + 1\n"); + "larger than missing_msbs + 2\n"); return false; } diff --git a/src/core/common/ojph_version.h b/src/core/common/ojph_version.h index 0c80e3d..b9e28e7 100644 --- a/src/core/common/ojph_version.h +++ b/src/core/common/ojph_version.h @@ -35,4 +35,4 @@ #define OPENJPH_VERSION_MAJOR 0 #define OPENJPH_VERSION_MINOR 8 -#define OPENJPH_VERSION_PATCH 1 +#define OPENJPH_VERSION_PATCH 2