Skip to content

Commit 25940a1

Browse files
authored
Bug fix (#244)
* A bug fix -- detect illegal codestream parameters. * Version bump.
1 parent 8e597d1 commit 25940a1

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/core/codestream/ojph_params.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,12 @@ namespace ojph {
735735
OJPH_ERROR(0x00050052, "error reading SIZ marker");
736736
if (file->read(&cptr[c].YRsiz, 1) != 1)
737737
OJPH_ERROR(0x00050053, "error reading SIZ marker");
738+
if (cptr[c].SSiz == 0 || cptr[c].SSiz > 38)
739+
OJPH_ERROR(0x00050054, "Wrong SIZ-SSiz value of %d", cptr[c].SSiz);
740+
if (cptr[c].XRsiz == 0)
741+
OJPH_ERROR(0x00050055, "Wrong SIZ-XRsiz value of %d", cptr[c].XRsiz);
742+
if (cptr[c].YRsiz == 0)
743+
OJPH_ERROR(0x00050056, "Wrong SIZ-YRsiz value of %d", cptr[c].YRsiz);
738744
}
739745

740746
ws_kern_support_needed = (Rsiz & 0x20) != 0;

src/core/openjph/ojph_version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@
3535

3636
#define OPENJPH_VERSION_MAJOR 0
3737
#define OPENJPH_VERSION_MINOR 26
38-
#define OPENJPH_VERSION_PATCH 0
38+
#define OPENJPH_VERSION_PATCH 1

0 commit comments

Comments
 (0)