Aspose.Imaging crashes with Stack overflow when loading tiff image on .Net

Hi,

I have issues with .Net Aspose.Imaging 24.2 when loading a tiff file.

The code is simple:

Aspose.Imaging.Image.Load(stream);

But this results in a hard process crash, i can not even catch it.

The active test run was aborted. Reason: Test host process crashed : Stack overflow.
   at #=zZ5A4lQNAc9oQU9Kva3tk1UpPZW9h.get_Disposed()
   at #=zZ5A4lQNAc9oQU9Kva3tk1UpPZW9h.#=zsL7Z9Gd4tw04()
   at #=zZ5A4lQNAc9oQU9Kva3tk1UpPZW9h.get_Position()
   at .get_Position()
   at .()
   at .(Int64, )
   at .(Byte[], Int32, Int64, Int64)
   at .(Int64, Int64)
   at .(Int64, Int64)
   at .(Int64)
   at .(, Int64)
   at .(, , Int64)
   at .(, , )
   at .(, )
   at .(, )
   at .(System.IO.Stream, )
   at .(System.IO.Stream)
   at .(System.IO.Stream, )
   at .(System.IO.Stream, )
   at System.Drawing.Bitmap..ctor(System.IO.Stream, Boolean)
   at System.Drawing.Bitmap..ctor(System.IO.Stream)
   at .(, , )
   at .(, )
   at .(, )
   at .(System.IO.Stream, )
   at .(System.IO.Stream)
   at .(System.IO.Stream, )
   at .(System.IO.Stream, )
   at System.Drawing.Bitmap..ctor(System.IO.Stream, Boolean)
   at System.Drawing.Bitmap..ctor(System.IO.Stream)
   at .(, , )
   at .(, )
   at .(, )
   at .(System.IO.Stream, )
   at .(System.IO.Stream)
   at .(System.IO.Stream, )
   at .(System.IO.Stream, )
   at System.Drawing.Bitmap..ctor(System.IO.Stream, Boolean)
   at System.Drawing.Bitmap..ctor(System.IO.Stream)
   at .(, , )
   at .(, )
   at .(, )
   at .(System.IO.Stream, )
   at .(System.IO.Stream)
   at .(System.IO.Stream, )
   at .(System.IO.Stream, )
   at System.Drawing.Bitmap..ctor(System.IO.Stream, Boolean)
   at System.Drawing.Bitmap..ctor(System.IO.Stream)
   at .(, , )
   at .(, )
   at .(, )
   at .(System.IO.Stream, )
   at .(System.IO.Stream)
   at .(System.IO.Stream, )
   at .(System.IO.Stream, )
   at System.Drawing.Bitmap..ctor(System.IO.Stream, Boolean)
   at System.Drawing.Bitmap..ctor(System.IO.Stream)
   at .(, , )
   at .(, )
   at .(, )
   at .(System.IO.Stream, )
   at .(System.IO.Stream)
   at .(System.IO.Stream, )
   at .(System.IO.Stream, )
   at System.Drawing.Bitmap..ctor(System.IO.Stream, Boolean)
   at System.Drawing.Bitmap..ctor(System.IO.Stream)
   at .(, , )
   at .(, )
   at .(, )
   at .(System.IO.Stream, )
   at .(System.IO.Stream)
   at .(System.IO.Stream, )
   at .(System.IO.Stream, )
   at System.Drawing.Bitmap..ctor(System.IO.Stream, Boolean)
   at System.Drawing.Bitmap..ctor(System.IO.Stream)
   at .(, , )
   at .(, )
   at .(, )
   at .(System.IO.Stream, )
   at .(System.IO.Stream)
   at .(System.IO.Stream, )
   at .(System.IO.Stream, )
   at System.Drawing.Bitmap..ctor(System.IO.Stream, Boolean)
   at System.Drawing.Bitmap..ctor(System.IO.Stream)
   at .(, , )
   at .(, )
   at .(, )
   at .(System.IO.Stream, )
   at .(System.IO.Stream)
   at .(System.IO.Stream, )
   at .(System.IO.Stream, )
   at System.Drawing.Bitmap..ctor(System.IO.Stream, Boolean)
   at System.Drawing.Bitmap..ctor(System.IO.Stream)
   at .(, , )
   at .(, )
   at .(, )
   at .(System.IO.Stream, )
   at .(System.IO.Stream)
   at .(System.IO.Stream, )
   at .(System.IO.Stream, )
   at System.Drawing.Bitmap..ctor(System.IO.Stream, Boolean)
   at System.Drawing.Bitmap..ctor(System.IO.Stream)
   at .(, , )
   at .(, )
   at .(, )
   at .(System.IO.Stream, )
   at .(System.IO.Stream)
   at .(System.IO.Stream, )
   at .(System.IO.Stream, )
   at System.Drawing.Bitmap..ctor(System.IO.Stream, Boolean)
   at System.Drawing.Bitmap..ctor(System.IO.Stream)
   at .(, , )
   at .(, )
   at .(, )
   at .(System.IO.Stream, )
   at .(System.IO.Stream)
   at .(System.IO.Stream, )
   at .(System.IO.Stream, )
   at System.Drawing.Bitmap..ctor(System.IO.Stream, Boolean)
   at System.Drawing.Bitmap..ctor(System.IO.Stream)
   at .(, , )
   at .(, )
   at .(, )
   at .(System.IO.Stream, )
   at .(System.IO.Stream)
   at .(System.IO.Stream, )
   at .(System.IO.Stream, )
   at System.Drawing.Bitmap..ctor(System.IO.Stream, Boolean)
   at System.Drawing.Bitmap..ctor(System.IO.Stream)
   at .(, , )
   at .(, )
   at .(, )
   at .(System.IO.Stream, )
   at .(System.IO.Stream)
   at .(System.IO.Stream, )
   at .(System.IO.Stream, )
   at System.Drawing.Bitmap..ctor(System.IO.Stream, Boolean)
   at System.Drawing.Bitmap..ctor(System.IO.Stream)
   at .(, , )
   at .(, )
   at .(, )
   at .(System.IO.Stream, )
   at .(System.IO.Stream)
   at .(System.IO.Stream, )
   at .(System.IO.Stream, )
   at System.Drawing.Bitmap..ctor(System.IO.Stream, Boolean)
   at System.Drawing.Bitmap..ctor(System.IO.Stream)
   at .(, , )
   at .(, )
   at .(, )
   at .(System.IO.Stream, )
   at .(System.IO.Stream)
   at .(System.IO.Stream, )
   at .(System.IO.Stream, )
   at System.Drawing.Bitmap..ctor(System.IO.Stream, Boolean)
   at System.Drawing.Bitmap..ctor(System.IO.Stream)
   at .(, , )
   at .(, )
   at .(, )
   at .(System.IO.Stream, )
   at .(System.IO.Stream)
   at .(System.IO.Stream, )
   at .(System.IO.Stream, )
   at System.Drawing.Bitmap..ctor(System.IO.Stream, Boolean)
   at System.Drawing.Bitmap..ctor(System.IO.Stream)
   at .(, , )
   at .(, )
   at .(, )
   at .(System.IO.Stream, )
   at .(System.IO.Stream)
   at .(System.IO.Stream, )
   at .(System.IO.Stream, )
   at System.Drawing.Bitmap..ctor(System.IO.Stream, Boolean)
   at System.Drawing.Bitmap..ctor(System.IO.Stream)
   at .(, , )
   at .(, )
   at .(, )
   at .(System.IO.Stream, )
   at .(System.IO.Stream)
   at .(System.IO.Stream, )
   at .(System.IO.Stream, )
   at System.Drawing.Bitmap..ctor(System.IO.Stream, Boolean)
   at System.Drawing.Bitmap..ctor(System.IO.Stream)
   at .(, , )
   at .(, )
   at .(, )
   at .(System.IO.Stream, )
   at .(System.IO.Stream)
   at .(System.IO.Stream, )
   at .(System.IO.Stream, )
   at System.Drawing.Bitmap..ctor(System.IO.Stream, Boolean)
   at System.Drawing.Bitmap..ctor(System.IO.Stream)
   at .(, , )
   at .(, )
   at .(, )
   at .(System.IO.Stream, )
   at .(System.IO.Stream)
   at .(System.IO.Stream, )
   at .(System.IO.Stream, )
   at System.Drawing.Bitmap..ctor(System.IO.Stream, Boolean)
   at System.Drawing.Bitmap..ctor(System.IO.Stream)
   at .(, , )
   at .(, )
   at .(, )
   at .(System.IO.Stream, )
   at .(System.IO.Stream)
 
========== Test run aborted: 0 Tests (0 Passed, 0 Failed, 0 Skipped) run in < 1 ms ==========

When running on Net6 there is no issue. When switching to Net7 or Net8 this errors occurs. Also on Windows, Linux or Docker.

  1. I checked that the tiff file is valid. I can open it in a viewer and “tiffinfo” reports a valid tiff file.
  2. I can provide the tiff file if needed. Its only 472kb big.

Regards

Hello, @Lockhead ,
Would you mind to share the TIFF file? So we can reproduce this error and provide a feedback!

Multi2.7z (23.7 KB)

Zipped

@Lockhead
The attached TIFF file contains a frame with JP2000 compression, which is currently not supported for TiffImage by Aspose.Imaging.
We have opened the following new ticket(s) in our internal issue tracking system to run an investigation on this issue and provide a feedback or a fix, delivered according to the terms mentioned in Free Support Policies.

Issue ID(s): IMAGINGNET-6961

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.