Somewhat hacky fix to crashes in A/B with some filters.
authorCarl Hetherington <cth@carlh.net>
Mon, 8 Jul 2013 22:10:01 +0000 (23:10 +0100)
committerCarl Hetherington <cth@carlh.net>
Mon, 8 Jul 2013 22:10:01 +0000 (23:10 +0100)
src/lib/combiner.cc

index 367cefa7f49fead4aa824798143fbf237dbeed74..f7d634832a7cf7a9d5111b73a110641f96017d28 100644 (file)
@@ -45,6 +45,14 @@ Combiner::process_video (shared_ptr<const Image> image, bool, shared_ptr<Subtitl
 void
 Combiner::process_video_b (shared_ptr<const Image> image, bool, shared_ptr<Subtitle> sub, double t)
 {
+       if (!_image) {
+               /* It's possible for filters in the A-side to mean that we get a B frame
+                  before any A; just skip the B frame in that case.  This at least prevents
+                  a crash, but may not be right.
+               */
+               return;
+       }
+       
        /* Copy the right half of this image into our _image */
        /* XXX: this should probably be in the Image class */
        for (int i = 0; i < image->components(); ++i) {