An off-by-one error was discovered in opjtcdcodeblockencallocatedata in lib/openjp2/tcd.c in OpenJPEG 2.2.0. The vulnerability causes an out-of-bounds write, which may lead to remote denial of service (heap-based buffer overflow affecting opjmqcflush in lib/openjp2/mqc.c and opjt1encode_cblk in lib/openjp2/t1.c) or possibly remote code execution.