Fix crash.
authorCarl Hetherington <cth@carlh.net>
Sat, 21 Jul 2018 21:09:04 +0000 (22:09 +0100)
committerCarl Hetherington <cth@carlh.net>
Sat, 21 Jul 2018 21:09:04 +0000 (22:09 +0100)
src/lib/film.cc

index fe7fcbfaee4375f8d3bacb0bb999fc90031d6c74..b56f85dbe8ba806f19270aa4c43ef16db9b12bcd 100644 (file)
@@ -778,13 +778,17 @@ Film::isdcf_name (bool if_created_now) const
        bool vf = false;
        BOOST_FOREACH (shared_ptr<Content> i, content ()) {
                shared_ptr<const DCPContent> dc = dynamic_pointer_cast<const DCPContent> (i);
+               if (!dc) {
+                       continue;
+               }
+
                bool any_caption = false;
                for (int i = 0; i < CAPTION_COUNT; ++i) {
                        if (dc->reference_caption(static_cast<CaptionType>(i))) {
                                any_caption = true;
                        }
                }
-               if (dc && (dc->reference_video() || dc->reference_audio() || any_caption)) {
+               if (dc->reference_video() || dc->reference_audio() || any_caption) {
                        vf = true;
                }
        }