]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Fix #1542 - timeshift: stop crash if speed/skip request w/o service
authorAdam Sutton <dev@adamsutton.me.uk>
Sun, 20 Jan 2013 12:41:58 +0000 (12:41 +0000)
committerAdam Sutton <dev@adamsutton.me.uk>
Sun, 20 Jan 2013 12:41:58 +0000 (12:41 +0000)
This can happen because XBMC may send requests even though the sub
has not yet started and the relevant links been made.

src/subscriptions.c

index 8dff4acf687aaadfdb298dc707cd4f597c0482b5..548fa7e9c54b672b0c71f8c5373a2a44672ae918 100644 (file)
@@ -643,6 +643,8 @@ subscription_set_speed ( th_subscription_t *s, int speed )
   streaming_message_t *sm;
   service_t *t = s->ths_service;
 
+  if (!t) return;
+
   pthread_mutex_lock(&t->s_stream_mutex);
 
   sm = streaming_msg_create_code(SMT_SPEED, speed);
@@ -661,6 +663,8 @@ subscription_set_skip ( th_subscription_t *s, const streaming_skip_t *skip )
   streaming_message_t *sm;
   service_t *t = s->ths_service;
 
+  if (!t) return;
+
   pthread_mutex_lock(&t->s_stream_mutex);
 
   sm = streaming_msg_create(SMT_SKIP);