fixed a bug in jp2_read_ihdr (need to allocate jp2->comps)
authorFreeimage <freeimage@aliceadsl.fr>
Thu, 19 Jan 2006 20:25:44 +0000 (20:25 +0000)
committerFreeimage <freeimage@aliceadsl.fr>
Thu, 19 Jan 2006 20:25:44 +0000 (20:25 +0000)
ChangeLog
libopenjpeg/jp2.c

index 753dde65a082bb52a5431a7057eafac4893fbc9f..f82a475c47fc62f4adf082dcd7b976d2a5c1d17b 100644 (file)
--- 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)
index 14e572f208b9f2ef1c3da6fc1414732313e3b2de..0d66e63e795d7e9288be058ffda8375805810bc9 100644 (file)
@@ -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 */