Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
IPTV: add NULL ptr check to iptv_http_complete callback
  • Loading branch information
perexg committed Nov 19, 2015
1 parent 752b62b commit 42fafd0
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/input/mpegts/iptv/iptv_http.c
Expand Up @@ -258,6 +258,8 @@ iptv_http_complete
url_t u;
int r;

if (hp == NULL || hp->im == NULL)
return 0;
if (hp->m3u_header) {
hp->m3u_header = 0;

Expand Down Expand Up @@ -352,17 +354,18 @@ iptv_http_start
hc->hc_data_complete = iptv_http_complete;
hc->hc_handle_location = 1; /* allow redirects */
hc->hc_io_size = 128*1024; /* increase buffering */
hp->hc = hc;
im->im_data = hp;
sbuf_init(&hp->m3u_sbuf);
sbuf_init_fixed(&im->mm_iptv_buffer, IPTV_BUF_SIZE);
http_client_register(hc); /* register to the HTTP thread */
r = http_client_simple(hc, u);
if (r < 0) {
http_client_close(hc);
im->im_data = NULL;
free(hp);
return SM_CODE_TUNING_FAILED;
}
hp->hc = hc;
im->im_data = hp;
sbuf_init(&hp->m3u_sbuf);
sbuf_init_fixed(&im->mm_iptv_buffer, IPTV_BUF_SIZE);

return 0;
}
Expand Down

0 comments on commit 42fafd0

Please sign in to comment.