Import patch from winfried on mailing list: patch for mj2.c in branch

This commit is contained in:
Mathieu Malaterre 2011-12-20 17:14:55 +00:00
parent a3a161660a
commit 6219ad32b0
1 changed files with 12 additions and 5 deletions

View File

@ -1098,6 +1098,7 @@ int mj2_read_smj2(opj_image_t * img, mj2_tk_t * tk, opj_cio_t *cio)
mj2_box_t box2; mj2_box_t box2;
int i; int i;
opj_jp2_color_t color; opj_jp2_color_t color;
opj_bool ok;
mj2_read_boxhdr(&box, cio); mj2_read_boxhdr(&box, cio);
@ -1156,8 +1157,14 @@ int mj2_read_smj2(opj_image_t * img, mj2_tk_t * tk, opj_cio_t *cio)
cio_skip(cio,2); /* Pre-defined = -1 */ cio_skip(cio,2); /* Pre-defined = -1 */
memset(&color, 0, sizeof(opj_jp2_color_t)); memset(&color, 0, sizeof(opj_jp2_color_t));
tk->jp2_struct.cinfo = tk->cinfo;
if (!jp2_read_jp2h(&tk->jp2_struct, cio, &color)) { ok = jp2_read_jp2h(&tk->jp2_struct, cio, &color);
tk->jp2_struct.cinfo = NULL;
if(ok == OPJ_FALSE)
{
opj_event_msg(tk->cinfo, EVT_ERROR, "Error reading JP2H Box\n"); opj_event_msg(tk->cinfo, EVT_ERROR, "Error reading JP2H Box\n");
return 1; return 1;
} }