Fix crash with a missing subtitle asset.
authorCarl Hetherington <cth@carlh.net>
Tue, 4 Apr 2017 22:15:06 +0000 (23:15 +0100)
committerCarl Hetherington <cth@carlh.net>
Tue, 4 Apr 2017 22:15:06 +0000 (23:15 +0100)
src/reel.cc

index b94197d0c569de827201ecc4fc3a9c4bb3fb9ebd..89fc3a45bc4e0e46856b3bb37d54c33f0e27b297 100644 (file)
@@ -230,9 +230,11 @@ Reel::resolve_refs (list<shared_ptr<Asset> > assets)
                _main_subtitle->asset_ref().resolve (assets);
 
                /* Interop subtitle handling is all special cases */
-               shared_ptr<InteropSubtitleAsset> iop = dynamic_pointer_cast<InteropSubtitleAsset> (_main_subtitle->asset_ref().asset ());
-               if (iop) {
-                       iop->resolve_fonts (assets);
+               if (_main_subtitle->asset_ref().resolved()) {
+                       shared_ptr<InteropSubtitleAsset> iop = dynamic_pointer_cast<InteropSubtitleAsset> (_main_subtitle->asset_ref().asset());
+                       if (iop) {
+                               iop->resolve_fonts (assets);
+                       }
                }
        }