mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-13 10:46:16 +03:00
Initialize libtiff buffer
This commit is contained in:
parent
e055ef0356
commit
93e5fd4b40
|
@ -771,11 +771,11 @@ ImagingLibTiffEncodeInit(ImagingCodecState state, char *filename, int fp) {
|
||||||
TRACE(("Opening using fd: %d for writing \n", clientstate->fp));
|
TRACE(("Opening using fd: %d for writing \n", clientstate->fp));
|
||||||
clientstate->tiff = TIFFFdOpen(fd_to_tiff_fd(clientstate->fp), filename, mode);
|
clientstate->tiff = TIFFFdOpen(fd_to_tiff_fd(clientstate->fp), filename, mode);
|
||||||
} else {
|
} else {
|
||||||
// malloc a buffer to write the tif, we're going to need to realloc or something
|
// calloc a buffer to write the tif, we're going to need to realloc or something
|
||||||
// if we need bigger.
|
// if we need bigger.
|
||||||
TRACE(("Opening a buffer for writing \n"));
|
TRACE(("Opening a buffer for writing \n"));
|
||||||
/* malloc check ok, small constant allocation */
|
/* calloc check ok, small constant allocation */
|
||||||
clientstate->data = malloc(bufsize);
|
clientstate->data = calloc(bufsize, 1);
|
||||||
clientstate->size = bufsize;
|
clientstate->size = bufsize;
|
||||||
clientstate->flrealloc = 1;
|
clientstate->flrealloc = 1;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user