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-Tag: v4.2.5~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=39dac90c7f9fb82e348f8ae5266f0705cdaabdd6;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 c6950b7c3..a42d41359 100644 --- a/src/api/api_epg.c +++ b/src/api/api_epg.c @@ -512,12 +512,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); @@ -542,12 +542,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) {