From: Freeimage Date: Thu, 19 Jan 2006 20:25:44 +0000 (+0000) Subject: fixed a bug in jp2_read_ihdr (need to allocate jp2->comps) X-Git-Tag: version.1.1~118 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=197b0505cb07544104f336d56384655c1f589f91;p=openjpeg fixed a bug in jp2_read_ihdr (need to allocate jp2->comps) --- diff --git a/ChangeLog b/ChangeLog index 753dde65..f82a475c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,9 @@ What's New for OpenJPEG ! : changed + : added +January 19, 2006 +* [Herve Drolon] fixed a bug in jp2_read_ihdr (need to allocate jp2->comps) + January 18, 2006 * [Herve Drolon] changed the name of j2k_realloc to opj_realloc * [Herve Drolon] fixed a bug in opj_cio_open when saving 48-bit images (wrong buffer size calculation) diff --git a/libopenjpeg/jp2.c b/libopenjpeg/jp2.c index 14e572f2..0d66e63e 100644 --- a/libopenjpeg/jp2.c +++ b/libopenjpeg/jp2.c @@ -161,6 +161,7 @@ static bool jp2_read_ihdr(opj_jp2_t *jp2, opj_cio_t *cio) { jp2->h = cio_read(cio, 4); /* HEIGHT */ jp2->w = cio_read(cio, 4); /* WIDTH */ jp2->numcomps = cio_read(cio, 2); /* NC */ + jp2->comps = (opj_jp2_comps_t*) opj_malloc(jp2->numcomps * sizeof(opj_jp2_comps_t)); jp2->bpc = cio_read(cio, 1); /* BPC */