Fix crash introduced by 6e5c998593842ff76f5d0ae5cab0d03cbe11b607. v2.13.128
authorCarl Hetherington <cth@carlh.net>
Mon, 11 Mar 2019 17:33:17 +0000 (17:33 +0000)
committerCarl Hetherington <cth@carlh.net>
Mon, 11 Mar 2019 17:33:17 +0000 (17:33 +0000)
src/lib/dcp_subtitle_decoder.cc

index 5d5e1f6311019dc5269b3f7f29856629fa65d6ac..3a182c0c7a20c4ea953c6ea02ad601c051029d60 100644 (file)
@@ -78,16 +78,16 @@ DCPSubtitleDecoder::pass ()
                if (ns) {
                        s.push_back (*ns);
                        ++_next;
-               }
-
-               /* XXX: perhaps these image subs should also be collected together like the string ones are;
-                  this would need to be done both here and in DCPDecoder.
-               */
-
-               shared_ptr<dcp::SubtitleImage> ni = dynamic_pointer_cast<dcp::SubtitleImage>(*_next);
-               if (ni) {
-                       emit_subtitle_image (p, *ni, film()->frame_size(), only_text());
-                       ++_next;
+               } else {
+                       /* XXX: perhaps these image subs should also be collected together like the string ones are;
+                          this would need to be done both here and in DCPDecoder.
+                       */
+
+                       shared_ptr<dcp::SubtitleImage> ni = dynamic_pointer_cast<dcp::SubtitleImage>(*_next);
+                       if (ni) {
+                               emit_subtitle_image (p, *ni, film()->frame_size(), only_text());
+                               ++_next;
+                       }
                }
        }