]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
coverity fixes
authorJaroslav Kysela <perex@perex.cz>
Wed, 17 Jan 2018 18:44:18 +0000 (19:44 +0100)
committerJaroslav Kysela <perex@perex.cz>
Wed, 17 Jan 2018 18:44:18 +0000 (19:44 +0100)
src/epg.c
src/input/mpegts/dvb_psi_hbbtv.c
src/input/mpegts/iptv/iptv.c
src/transcoding/memutils.c
src/webui/webui.c

index cf99a37e4378237936d43e693eac8647b4c43a08..6f7db3bfd81bb3c26e7c87b115f8b26f0c2e8c6c 100644 (file)
--- a/src/epg.c
+++ b/src/epg.c
@@ -1153,9 +1153,9 @@ int epg_episode_set_season
     episode->season = season;
     if (season) {
       _epg_season_add_episode(season, episode);
-      save |= epg_episode_set_brand(episode, season->brand ?: NULL, changed);
+      epg_episode_set_brand(episode, season->brand ?: NULL, changed);
     } else {
-      save |= epg_episode_set_brand(episode, NULL, changed);
+      epg_episode_set_brand(episode, NULL, changed);
     }
     _epg_object_set_updated(episode);
     save = 1;
index 2fe5b11e95f74cf8555d9b7a273fe5a2fc2b2d55..859e8f19a1b87feecf6f171023277392afbcbda1 100644 (file)
@@ -101,7 +101,7 @@ ts_recv_hbbtv_cb(mpegts_psi_table_t *mt, const uint8_t *buf, int len)
         break;
       case DVB_DESC_APP_NAME:
         titles = htsmsg_create_list();
-        while (dlen > 4 && l3 > 4) {
+        while (dlen > 4) {
           r = dvb_get_string_with_len(title, sizeof(title), dptr + 3, dlen - 3, "UTF-8", NULL);
           if (r < 0) goto dvberr;
           tvhtrace(mt->mt_subsys, "%s:      lang '%c%c%c' name '%s'", mt->mt_name, dptr[0], dptr[1], dptr[2], title);
index aadd4b806367cdc2053f4538f54fa7731d4f4dfc..97c82b3293dd4f155518dc20414ba44a8836520b 100644 (file)
@@ -338,7 +338,7 @@ iptv_input_start_mux ( mpegts_input_t *mi, mpegts_mux_instance_t *mmi, int weigh
   /* Start */
   pthread_mutex_lock(&iptv_lock);
   s = im->mm_iptv_url_raw;
-  im->mm_iptv_url_raw = strdup(raw);
+  im->mm_iptv_url_raw = raw ? strdup(raw) : NULL;
   if (im->mm_iptv_url_raw) {
     im->mm_active = mmi; // Note: must set here else mux_started call
                          // will not realise we're ready to accept pid open calls
index 97044fc09fa39ab272c1a3078ca2f221e9403981..d7ebca85ebc433d516f71fcdb46699cacbfd7e5e 100644 (file)
@@ -64,6 +64,7 @@ str_vjoin(const char *separator, va_list ap)
                     strcpy(result + result_size - 1, str);
                     result_size += str_len;
                 } else {
+                    str_clear(str);
                     goto reterr;
                 }
             }
index 7cf792df26320445ab0f84c7a39736b4a744f5a1..28682c3d950f013543c73987baab0e4c63b65615 100644 (file)
@@ -748,8 +748,7 @@ http_channel_list_playlist(http_connection_t *hc, int pltype)
   channel_t **chlist;
   int idx = 0, count = 0;
   char *profile, *hostpath;
-  const char *name, *blank, *sort;
-  const char *lang = hc->hc_access->aa_lang_ui;
+  const char *name, *blank, *sort, *lang;
 
   if(hc->hc_access == NULL ||
      access_verify2(hc->hc_access, ACCESS_STREAMING))
@@ -757,6 +756,7 @@ http_channel_list_playlist(http_connection_t *hc, int pltype)
 
   hq = &hc->hc_reply;
 
+  lang = hc->hc_access->aa_lang_ui;
   profile = profile_validate_name(http_arg_get(&hc->hc_req_args, "profile"));
   hostpath = http_get_hostpath(hc);
   sort = http_arg_get(&hc->hc_req_args, "sort");