Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge PR #784
remote-tracking branch 'upstream/pr/784'
  • Loading branch information
adamsutton committed Jan 18, 2016
2 parents 319eb00 + 1c024df commit e832d1b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/descrambler/cwc.c
Expand Up @@ -402,7 +402,7 @@ cwc_send_msg(cwc_t *cwc, const uint8_t *msg, size_t len, int sid, int enq, uint1
{
cwc_message_t *cm = malloc(sizeof(cwc_message_t));
uint8_t *buf = cm->cm_data;
int seq;
int seq, ret;

if (len < 3 || len + 12 > CWS_NETMSGSIZE) {
free(cm);
Expand All @@ -427,10 +427,11 @@ cwc_send_msg(cwc_t *cwc, const uint8_t *msg, size_t len, int sid, int enq, uint1
// adding packet header size
len += 12;

if((len = des_encrypt(buf, len, cwc)) <= 0) {
if((ret = des_encrypt(buf, len, cwc)) <= 0) {
free(cm);
return -1;
}
len = (size_t)ret;

tvhtrace("cwc", "sending message sid %d len %zu enq %d", sid, len, enq);
tvhlog_hexdump("cwc", buf, len);
Expand Down
2 changes: 0 additions & 2 deletions src/httpc.c
Expand Up @@ -1093,8 +1093,6 @@ http_client_run( http_client_t *hc )
res = 0;
}
r += hc->hc_csize;
if (res < 0)
return http_client_flush(hc, res);
hc->hc_in_rtp_data = 1;
hc->hc_code = 0;
res = http_client_finish(hc);
Expand Down
3 changes: 2 additions & 1 deletion src/imagecache.c
Expand Up @@ -252,7 +252,7 @@ imagecache_image_fetch ( imagecache_image_t *img )
char tpath[PATH_MAX] = "", path[PATH_MAX];
tvhpoll_event_t ev;
tvhpoll_t *efd = NULL;
http_client_t *hc;
http_client_t *hc = NULL;

lock_assert(&global_lock);

Expand Down Expand Up @@ -316,6 +316,7 @@ imagecache_image_fetch ( imagecache_image_t *img )
error_lock:
pthread_mutex_lock(&global_lock);
error:
if (NULL != hc) http_client_close(hc);
urlreset(&url);
tvhpoll_destroy(efd);
img->state = IDLE;
Expand Down
8 changes: 8 additions & 0 deletions src/input/mpegts/mpegts_input.c
Expand Up @@ -475,6 +475,12 @@ mpegts_input_open_pid
tvhdebug("mpegts", "%s - open PID %s subscription [%04x/%p]",
buf, (type & MPS_TABLES) ? "tables" : "fullmux", type, owner);
mm->mm_update_pids_flag = 1;
} else {
tvherror("mpegts",
"%s - open PID %04x (%d) failed, dupe sub (owner %p)",
buf, mp->mp_pid, mp->mp_pid, owner);
free(mps);
mp = NULL;
}
} else if (!RB_INSERT_SORTED(&mp->mp_subs, mps, mps_link, mpegts_mps_cmp)) {
mp->mp_type |= type;
Expand All @@ -487,6 +493,8 @@ mpegts_input_open_pid
buf, mp->mp_pid, mp->mp_pid, type, owner);
mm->mm_update_pids_flag = 1;
} else {
tvherror("mpegts", "%s - open PID %04x (%d) failed, dupe sub (owner %p)",
buf, mp->mp_pid, mp->mp_pid, owner);
free(mps);
mp = NULL;
}
Expand Down

0 comments on commit e832d1b

Please sign in to comment.