mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 17:36:18 +03:00
Merge pull request #2263 from wiredfool/tiff_bytesio
Fix for writing Tiff to BytesIO using libtiff
This commit is contained in:
commit
e83479edf0
|
@ -39,6 +39,8 @@ class LibTiffTestCase(PillowTestCase):
|
|||
out = self.tempfile("temp.png")
|
||||
im.save(out)
|
||||
|
||||
out_bytes = io.BytesIO()
|
||||
im.save(out_bytes, format='tiff', compression='group4')
|
||||
|
||||
class TestFileLibTiff(LibTiffTestCase):
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ tsize_t _tiffWriteProc(thandle_t hdata, tdata_t buf, tsize_t size) {
|
|||
tdata_t new;
|
||||
tsize_t newsize=state->size;
|
||||
while (newsize < (size + state->size)) {
|
||||
if (newsize > (tsize_t)SIZE_MAX - 64*1024){
|
||||
if (newsize > INT_MAX - 64*1024){
|
||||
return 0;
|
||||
}
|
||||
newsize += 64*1024;
|
||||
|
|
Loading…
Reference in New Issue
Block a user