Avoid nullptr access
ClosedPublic

Authored by broulik on Oct 18 2018, 7:12 AM.

Details

Summary

When we get a bogus file bbox() may be null and accessing it will crash the thumbnailer.

CHANGELOG: Fixed crash when trying to generate a thumbnail for bogus .eps files

BUG: 399896
FIXED-IN: 18.08.3

Test Plan

No longer crashes when using the provided test file in the bug report
PDFs and genuine PS files are still generated correctly

There's still a chance that previewType becomes CDSC_EPSI and then we access bbox again but not sure how likely that ancient code is to set a type when it failed to analyze it.

Diff Detail

Repository
R373 Image Thumbnailers
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
broulik requested review of this revision.Oct 18 2018, 7:12 AM
broulik created this revision.
sitter accepted this revision.Oct 19 2018, 9:33 AM
sitter added a subscriber: sitter.

That condition is making me sad. Change looks good though ๐Ÿ‘

This revision is now accepted and ready to land.Oct 19 2018, 9:33 AM
This revision was automatically updated to reflect the committed changes.