fixed a bug in opj_cio_open when saving 48-bit images (wrong buffer size calculation)

This commit is contained in:
Freeimage 2006-01-18 20:10:58 +00:00
parent 8f9f70f922
commit d5ecae07ad
1 changed files with 1 additions and 1 deletions

View File

@ -57,7 +57,7 @@ opj_cio_t* opj_cio_open(opj_common_ptr cinfo, unsigned char *buffer, int length)
opj_free(cio); opj_free(cio);
return NULL; 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); cio->buffer = (unsigned char *)opj_malloc(cio->length);
if(!cio->buffer) { if(!cio->buffer) {
opj_free(cio); opj_free(cio);