This commit is contained in:
Francois-Olivier Devaux
2007-07-13 13:07:07 +00:00
parent 4a50efe542
commit 5dec8bbbe9
7 changed files with 239 additions and 212 deletions

View File

@@ -58,7 +58,7 @@ opj_cio_t* OPJ_CALLCONV opj_cio_open(opj_common_ptr cinfo, unsigned char *buffer
opj_free(cio);
return NULL;
}
cio->length = (int) (0.1625 * cp->img_size); /* 0.1625 = 1.3/8 */
cio->length = (int) (0.1625 * cp->img_size + 2000); /* 0.1625 = 1.3/8 and 2000 bytes as a minimum for headers */
cio->buffer = (unsigned char *)opj_malloc(cio->length);
if(!cio->buffer) {
opj_free(cio);