]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
mpegts: fix possible recursion, causing strange crashes 417/head
authorAdam Sutton <dev@adamsutton.me.uk>
Mon, 9 Jun 2014 20:13:22 +0000 (21:13 +0100)
committerAdam Sutton <dev@adamsutton.me.uk>
Mon, 9 Jun 2014 21:08:41 +0000 (22:08 +0100)
I'm not entirely sure what has changed that has made this a problem
where it apparently wasn't before. That being said, its not nice and
would previously have said it might cause undesirable side-effects.
I would have been right!

src/input/mpegts/mpegts_mux.c

index 18d7e034c385765d05a224d7f4140f010d53a1b4..d0570068f62b61d992cd218bc50438088ed3d001 100644 (file)
@@ -576,6 +576,10 @@ mpegts_mux_stop ( mpegts_mux_t *mm, int force )
   if (!force && mpegts_mux_has_subscribers(mm))
     return;
 
+  /* Stop possible recursion */
+  if (!mmi) return;
+  mm->mm_active = NULL;
+
   mm->mm_display_name(mm, buf, sizeof(buf));
   tvhdebug("mpegts", "%s - stopping mux", buf);