fixed a bug in opj_cio_open when saving 48-bit images (wrong buffer size calculation)
authorFreeimage <freeimage@aliceadsl.fr>
Wed, 18 Jan 2006 20:10:58 +0000 (20:10 +0000)
committerFreeimage <freeimage@aliceadsl.fr>
Wed, 18 Jan 2006 20:10:58 +0000 (20:10 +0000)
libopenjpeg/cio.c

index 0b701baf4edda24f85022b122fb0d8990ba43851..c9c59bc243a2f758b3a67e04d1f77c86478080f8 100644 (file)
@@ -57,7 +57,7 @@ opj_cio_t* opj_cio_open(opj_common_ptr cinfo, unsigned char *buffer, int length)
                                opj_free(cio);
                                return NULL;
                }
-               cio->length = cp->tdx * cp->tdy * cp->tw * cp->th * 2;
+               cio->length = cp->tdx * cp->tdy * cp->tw * cp->th * 4;
                cio->buffer = (unsigned char *)opj_malloc(cio->length);
                if(!cio->buffer) {
                        opj_free(cio);