Fix for DVB subtitles crash at exit (with plugin primary device)

Message ID 1116438105.22482.9.camel@bobcat.mine.nu
State New
Headers

Commit Message

Ville Skyttä May 18, 2005, 5:41 p.m. UTC
  Here's a patch for the subtitles plugin that fixes a crash when shutting
down VDR.  Patch already sent upstream.

The crash can probably occur only when the primary device is implemented
by a plugin which has already been shut down before the DVB subtitles
plugin.
  

Patch

--- sync.c~	2005-02-15 12:08:01.000000000 +0200
+++ sync.c	2005-05-16 20:12:07.000000000 +0300
@@ -24,7 +24,9 @@ 
 int64_t cStcSynchronizer::GetSTC(bool fix)
 {
 
-  int64_t stc =  cDevice::PrimaryDevice()->GetSTC();
+  int64_t stc = -1;
+  if (cDevice *pd = cDevice::PrimaryDevice())
+    stc = pd->GetSTC();
 
   // add the 33rd bit if required
   if (fix)