When LR tries to export a photo that's corrupt, the export hangs and never completes. It should produce an error message instead.
Worse, there isn't a way for a plugin to detect and recover gracefully. The call to rendition:waitForRender() will never return, even after the user cancels the corresponding task in the progress bar. Several of my plugins rely on exporting photos, e.g. Any Vision.
To reproduce on LR 13.2 / Mac OS 14.4.1:
1. Download this tiny catalog:
https://www.dropbox.com/scl/fi/48dtex70opjseeyhsm0hn/corrupt-bug.2024.04.25.zip?rlkey=hrf6fsoogaklqw...
2. Copy the script "corrupt-bug.lua" from the catalog folder into the Scripts subfolder of the Lightroom settings folder.
3. Start LR.
4. Select the one photo and do File > Export, exporting it as a JPEG. Observe that the export never completes, with the progress bar showing:

Also observe that the following error appears when LR is run from Terminal with the -traceback switch:
2024-04-25 18:36:11.364 Adobe Lightroom Classic[91358:6685632] openNegative: <AgErrorID>dng_error_bad_format</AgErrorID>
5. Restart LR.
6. Select the one photo and do Scripts > corrupt-bug. Observe that the export initiated by the script never completes (it should display a message when it does):

7. Cancel both export tasks in the progress bar by clicking their "x". Observe that no dialog is displayed by the script, indicating that the call to rendition:waitForRender() has never returned, even though the export has been cancelled.