From: Jaroslav Kysela Date: Wed, 25 Oct 2017 12:28:12 +0000 (+0200) Subject: epg api: fix the eventId check in api_epg_alternative/api_epg_related functions,... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7d0e509ba0b73d2187bc27329e72c869f8c2f2b8;p=thirdparty%2Ftvheadend.git epg api: fix the eventId check in api_epg_alternative/api_epg_related functions, fixes #4688 --- diff --git a/src/api/api_epg.c b/src/api/api_epg.c index 8a39d6e36..47a4494c7 100644 --- a/src/api/api_epg.c +++ b/src/api/api_epg.c @@ -528,12 +528,12 @@ api_epg_alternative epg_broadcast_t *e; char *lang; - if (!htsmsg_get_u32(args, "eventId", &id)) + if (htsmsg_get_u32(args, "eventId", &id)) return -EINVAL; /* Main Job */ - pthread_mutex_lock(&global_lock); lang = access_get_lang(perm, htsmsg_get_str(args, "lang")); + pthread_mutex_lock(&global_lock); e = epg_broadcast_find_by_id(id); if (e && e->episode) api_epg_episode_broadcasts(perm, l, lang, e->episode, &entries, e); @@ -558,12 +558,12 @@ api_epg_related epg_episode_t *ep, *ep2; char *lang; - if (!htsmsg_get_u32(args, "eventId", &id)) + if (htsmsg_get_u32(args, "eventId", &id)) return -EINVAL; /* Main Job */ - pthread_mutex_lock(&global_lock); lang = access_get_lang(perm, htsmsg_get_str(args, "lang")); + pthread_mutex_lock(&global_lock); e = epg_broadcast_find_by_id(id); ep = e ? e->episode : NULL; if (ep && ep->brand) {