Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
tvhdhomerun: warn user when pid is too large, and restrict pid to max…
…imum
  • Loading branch information
beralt authored and perexg committed Jun 4, 2016
1 parent c1c5fa5 commit e371eb0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/input/mpegts/tvhdhomerun/tvhdhomerun_frontend.c
Expand Up @@ -331,7 +331,10 @@ static void tvhdhomerun_device_open_pid(tvhdhomerun_frontend_t *hfe, int pid) {
tvhdebug("tvhdhomerun", "current pfilter: %s", pfilter);

/* make sure the pid maps to a max of 0x1FFF, API will reject the call otherwise */
pid = (pid & 0x1FFF);
if(pid > 0x1FFF) {
tvhlog(LOG_ERR, "tvhdhomerun", "pid %d is too large, masking to API maximum of 0x1FFF", pid);
pid = (pid & 0x1FFF);
}

memset(buf, 0x00, sizeof(buf));
snprintf(buf, sizeof(buf), "0x%04x", pid);
Expand Down

0 comments on commit e371eb0

Please sign in to comment.