You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The text was updated successfully, but these errors were encountered:
rouault
changed the title
memory allocation failure in opj_aligned_alloc_n (opj_malloc.c) Unfixed #983
Big memory allocation attempt on input TIFF files with big dimensions
Aug 16, 2017
Note: This is different from #983 which was about input BMP. Here it is about input TIFF
This images advertizes itself as rather big, so the memory allocation is rather logical:
$ tiffinfo ../00320-openjpeg-memallocfailure-opj_aligned_alloc_n.tif
TIFFReadDirectoryCheckOrder: Warning, Invalid TIFF directory; tags are not sorted in ascending order.
TIFFReadDirectory: Warning, Unknown field with tag 786 (0x312) encountered.
TIFFReadDirectory: Warning, Unknown field with tag 65535 (0xffff) encountered.
TIFFReadDirectory: Warning, Unknown field with tag 769 (0x301) encountered.
TIFFReadDirectory: Warning, Unknown field with tag 1 (0x1) encountered.
TIFFReadDirectory: Warning, TIFF directory is missing required "StripByteCounts" field, calculating from imagelength.
TIFF Directory at offset 0xa (10)
Image Width: 513 Image Length: 167782985
Bits/Sample: 1
Compression Scheme: None
Photometric Interpretation: min-is-black
FillOrder: msb-to-lsb
Samples/Pixel: 2
Planar Configuration: single image plane
Tag 786: 1
We could potentially check the file size against its expected size as it is a uncompressed TIFF file, but this wouldn't solve the issue in the general case. You could have a very small compressed TIFF file size that would expand to something very large once uncompressed
On master, I still get the failure:
Testcase:
https://github.com/asarubbo/poc/blob/master/00320-openjpeg-memallocfailure-opj_aligned_alloc_n
The text was updated successfully, but these errors were encountered: