Aspose.Words Version 13.5.0.0 - Aspose.Words.FileCorruptedException was caught ... Unable to read beyond the end of the stream

I get Aspose.Words crashing on a few files. I believe it is due to the fact that there are images with a file length of 0.

These empty images do not cause MS Word to crash and are used in other application to insert specific images at different stages in the life cycle of the document.

I have included sample code and Stack trace of the error.

Example C# Code:

var loadOptions = new Aspose.Words.LoadOptions()
{
LoadFormat = LoadFormat.Docx,
PreserveIncludePictureField = true
};

var doc = new Aspose.Words.Document(sourceFile, loadOptions);


Error Stack Trace:

Aspose.Words.FileCorruptedException was caught
HResult=-2146233088
Message=The document appears to be corrupted and cannot be loaded.
Source=Aspose.Words
StackTrace:
at Aspose.Words.Document.x5d4db34d48fb3129(Stream xcf18e5243f8d5fd3, LoadOptions x27aceb70372bde46)
at Aspose.Words.Document.x5d95f5f98c940295(Stream xcf18e5243f8d5fd3, LoadOptions x27aceb70372bde46)
at Aspose.Words.Document..ctor(String fileName, LoadOptions loadOptions)
at {OurFunction} in {PathToOurSourceFile}:line 94
InnerException: System.IO.EndOfStreamException
HResult=-2147024858
Message=Unable to read beyond the end of the stream.
Source=mscorlib
StackTrace:
at System.IO.MemoryStream.InternalReadInt32()
at x38a89dee67fc7a16.xdd1b8f14cc8ba86d.x1bfd70c1f4fe13bd(Stream xcf18e5243f8d5fd3)
at x38a89dee67fc7a16.xdd1b8f14cc8ba86d.x1bfd70c1f4fe13bd(Byte[] x4a3f0a05c02f235f)
at x13cd31bb39e0b7ea.x9190101bb5c1ce1b.VisitDrawingML(DrawingML drawingML)
at Aspose.Words.Drawing.DrawingML.Accept(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.x464d2134480a7bf2(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.CompositeNode.xf7ae36cd24e0b11c(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.Markup.StructuredDocumentTag.Accept(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.x464d2134480a7bf2(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.CompositeNode.xf7ae36cd24e0b11c(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.Paragraph.Accept(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.x464d2134480a7bf2(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.CompositeNode.xf7ae36cd24e0b11c(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.Tables.Cell.Accept(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.x464d2134480a7bf2(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.CompositeNode.xf7ae36cd24e0b11c(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.Tables.Row.Accept(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.x464d2134480a7bf2(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.CompositeNode.xf7ae36cd24e0b11c(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.Tables.Table.Accept(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.x464d2134480a7bf2(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.CompositeNode.xf7ae36cd24e0b11c(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.Tables.Cell.Accept(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.x464d2134480a7bf2(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.CompositeNode.xf7ae36cd24e0b11c(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.Tables.Row.Accept(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.x464d2134480a7bf2(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.CompositeNode.xf7ae36cd24e0b11c(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.Tables.Table.Accept(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.x464d2134480a7bf2(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.CompositeNode.xf7ae36cd24e0b11c(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.Body.Accept(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.x464d2134480a7bf2(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.CompositeNode.xf7ae36cd24e0b11c(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.Section.Accept(DocumentVisitor visitor)
at Aspose.Words.CompositeNode.x464d2134480a7bf2(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.CompositeNode.xf7ae36cd24e0b11c(DocumentVisitor x672ff13faf031f3d)
at Aspose.Words.Document.Accept(DocumentVisitor visitor)
at x13cd31bb39e0b7ea.x9190101bb5c1ce1b.x18dfca7c5fd2402f(Document x6beba47238e0ade6, LoadOptions x27aceb70372bde46)
at Aspose.Words.Document.x5d4db34d48fb3129(Stream xcf18e5243f8d5fd3, LoadOptions x27aceb70372bde46)
InnerException:


Kind regards
Hi Enoque,

Thanks for your inquiry.

While using the latest version of Aspose.Words i.e. 13.6.0, I managed to reproduce this exception on my side. I have logged this issue in our bug tracking system. The ID of your issue is WORDSNET-8648. Your request has also been linked to this issue and you will be notified via this thread as soon as it is resolved. Sorry for the inconvenience.

Best regards,

The issues you have found earlier (filed as WORDSNET-8648) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.