vdr-1.5.6 crashing (workaround)

Message ID 46AB428D.2080004@cadsoft.de
State New
Headers

Commit Message

Klaus Schmidinger July 28, 2007, 1:20 p.m. UTC
  On 07/24/07 13:09, Malte Schröder wrote:
> On Mon, 23 Jul 2007 16:20:23 +0200
> Malte Schröder <maltesch@gmx.de> wrote:
> 
>> Hello,
>> when I switch for example to sunshine live 1.5.6 crashes. Plugins loaded
>> are remote, skinenigmang and epgsearch.
> 
> This prevents vdr from crashing. But I don't understand how channel
> can be a null-pointer in that code-path. It is only set at the start of
> the method and then checked if it is a null-pointer. Okay, it is
> being re-set a few lines before, but that is in the true part of the
> condition.
> 
> --- vdr-1.5.6/eit.c     2007-07-21 16:58:04.000000000 +0200
> +++ vdr-1.5.6.prod/eit.c        2007-07-24 12:06:46.000000000 +0200
> @@ -209,7 +209,7 @@
>                               LinkChannels->Add(new cLinkChannel(link));
>                               }
>                            }
> -                       else
> +                       else if(channel)
>                            channel->SetPortalName(linkName);
>                         }
>                      }
> @@ -256,7 +256,7 @@
> 
>        if (!HasExternalData)
>           pEvent->FixEpgBugs();
> -      if (LinkChannels)
> +      if (LinkChannels && channel)
>           channel->SetLinkChannels(LinkChannels);
>        Modified = true;
>        }

I believe the actual problem was introduced by myself.
I wanted to simplify the original patch to have only a single
call to Channels.NewChannel(), and in doing so wrote
channel = ... instead of transponder = ...

Please try the attached patch.

Klaus
  

Comments

Malte Schröder July 28, 2007, 3:15 p.m. UTC | #1
On Sat, 28 Jul 2007 15:20:13 +0200
Klaus Schmidinger <Klaus.Schmidinger@cadsoft.de> wrote:
> I believe the actual problem was introduced by myself.
> I wanted to simplify the original patch to have only a single
> call to Channels.NewChannel(), and in doing so wrote
> channel = ... instead of transponder = ...
> 
> Please try the attached patch.

Seems to work (i.e. no crashes), thanks :)
  

Patch

--- eit.c	2007/07/21 14:58:04	1.124
+++ eit.c	2007/07/28 13:16:43
@@ -199,7 +199,7 @@ 
                           else if (Setup.UpdateChannels >= 4) {
                              cChannel *transponder = channel;
                              if (channel->Tid() != ld->getTransportStreamId())
-                                channel = Channels.GetByTransponderID(linkID);
+                                transponder = Channels.GetByTransponderID(linkID);
                              link = Channels.NewChannel(transponder, linkName, "", "", ld->getOriginalNetworkId(), ld->getTransportStreamId(), ld->getServiceId());
                              //XXX patFilter->Trigger();
                              }