[Aspose.PSD NET] - 'Arithmetic operation resulted in an overflow' when creating smart object layer using large JPEG

Hi, creating a new smart object layer using a JPEG with large dimensions will result in System.OverflowException: ‘Arithmetic operation resulted in an overflow.’:

            using (var image = (PsdImage)Image.Load("source.psd", new PsdLoadOptions { DataRecoveryMode = DataRecoveryMode.MaximalRecover }))
            {
                using (var stream = new FileStream("test.jpg", FileMode.Open))
                {
                    var addedLayer = new SmartObjectLayer(stream);
                    addedLayer.Name = "Test Layer";
                    image.AddLayer(addedLayer);
                }
            }

AsposeDemo.zip (2.5 MB)

Exception details:

System.OverflowException
  HResult=0x80131516
  Message=Arithmetic operation resulted in an overflow.
  Source=Aspose.PSD
  StackTrace:
   at Aspose.PSD.FileFormats.Psd.Layers.SmartObjects.SmartObjectLayer.(RasterImage , ResolutionSetting , Boolean )
   at Aspose.PSD.FileFormats.Psd.Layers.SmartObjects.SmartObjectLayer.(Image , ResolutionSetting , Boolean )
   at Aspose.PSD.FileFormats.Psd.Layers.SmartObjects.SmartObjectLayer.(Image , ResolutionSetting , Boolean )
   at Aspose.PSD.FileFormats.Psd.Layers.SmartObjects.SmartObjectLayer.ReplaceContents(Image image, ResolutionSetting resolution)
   at Aspose.PSD.FileFormats.Psd.Layers.SmartObjects.SmartObjectLayer.ReplaceContents(Image image)
   at Aspose.PSD.FileFormats.Psd.Layers.SmartObjects.SmartObjectLayer..ctor(Stream stream)
   at AsposeDemo.Program.Main(String[] args) in D:\Code\AsposeDemo\Program.cs:line 23

@OrangeLogic
I can confirm issue.
We have opened the following new ticket(s) in our internal issue tracking system with High Priorirty and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PSDNET-2085

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.

The issues you have found earlier (filed as PSDNET-2085) have been fixed in this update. This message was posted using Bugs notification tool by yaroslav.lisovskyi