How to Find Out If a PowerPoint Presentation File Is Corrupted or Not in Java?

We are using Aspose.Slides Java v24.7 to convert ppt document into text, but when user passes any corrupted file then we are getting Out of memory error from Aspose library. I used below code to check file is corrupted or not, and it takes almost 4GB Heap memory for 10 MB corrupted file (attached for reference), to check file is corrupted or not.

InputStream inputStream = new FileInputStream("/File124.ppt");
IPresentationInfo info = PresentationFactory.getInstance().getPresentationInfo(inputStream);
if (info.getLoadFormat() == 255) {
    System.out.println("File is corrupted!");
}

So, Can you please suggest a better way to check if a file is corrupted or not?
File124.zip (4.7 MB)

@harsh7031,
Thank you for contacting support. I’ve reproduced the problem you described.

At the moment I cannot answer this question.

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): SLIDESJAVA-39516

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.

Please also share the following additional information if it is possible:

  • OS version on which the code was executed
  • JDK target version in your application project

@ andrey.potapov
Thanks for your quick response.
Here are requested details:

  • OS version: Alpine Linux v3.20
  • JDK version: openJdk 17.0.12

@harsh7031,
Thank you for the additional information. I’ve forwarded it to our developers.

1 Like

Hello @andrey.potapov I am working with @harsh7031
Do you have an update on the resolution of SLIDESJAVA-39516? Is there any way to track status/progress of this issue? I did not find it.
Thanks in advance for your help on that!

@ambroiseL,
The issue is still open. Unfortunately, I don’t have any additional information yet. We apologize for any inconvenience caused.

You can see the issue’s status at the bottom of this forum thread.

Sorry @andrey.potapov but I do not see any status at the end of this thread. Thank you for the update

@ambroiseL,
Please take a look at the following screenshot: status.png (54.6 KB)

hello @andrey.potapov
I cannot view the file you sent: “Sorry, this file is private. Only visible to topic owner and staff members.”

@ambroiseL,
I am sorry, please take a look at the following screenshot:

Hello @andrey.potapov is the issue still blocked? Do you know why it is blocked? Thank you

@ambroiseL,
The issue has been blocked by a similar issue in Aspose.Slides for .NET. Unfortunately, I don’t have any additional information yet.