diff --git a/src/lib/openjp3d/cio.c b/src/lib/openjp3d/cio.c index 10bd2af3..7b2c5e4e 100644 --- a/src/lib/openjp3d/cio.c +++ b/src/lib/openjp3d/cio.c @@ -58,6 +58,7 @@ opj_cio_t* OPJ_CALLCONV opj_cio_open(opj_common_ptr cinfo, unsigned char *buffer cio->length = cp->tdx * cp->tdy * cp->tdz * cp->tw * cp->th * cp->tl * 4; cio->buffer = (unsigned char *)opj_malloc(cio->length); if(!cio->buffer) { + opj_event_msg(cio->cinfo, EVT_ERROR, "Error allocating memory for compressed bitstream\n"); opj_free(cio); return NULL; } diff --git a/src/lib/openjp3d/t2.c b/src/lib/openjp3d/t2.c index 7fd551e5..65d98c13 100644 --- a/src/lib/openjp3d/t2.c +++ b/src/lib/openjp3d/t2.c @@ -479,6 +479,7 @@ int t2_decode_packet(opj_t2_t* t2, unsigned char *src, int len, opj_tcd_tile_t * if (tcp->csty & J3D_CP_CSTY_EPH) { if ((*hd) != 0xff || (*(hd + 1) != 0x92)) { opj_event_msg(t2->cinfo, EVT_ERROR, "Expected EPH marker\n"); + return -999; } else { hd += 2; }