]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Fix weird channel numbers
authorRicardo Pontes <rjgpp.1994@hotmail.com>
Fri, 13 Jan 2017 00:42:24 +0000 (00:42 +0000)
committerJaroslav Kysela <perex@perex.cz>
Fri, 13 Jan 2017 08:15:12 +0000 (09:15 +0100)
When selecting "Use service IDs as channel numbers" in the network settings, the s_dvb_service_id (uint16) multiplied by CHANNEL_SPLIT (uint64), would produce a value that would overflow the r variable (int) if the service id is high enough, causing the result to be weird numbers.

src/input/mpegts/mpegts_service.c

index e426dd1d390bd44c1bae35bcabb75b078d62242c..5e37d4e8311beec3a39c5a932c960d98878cd9ae 100644 (file)
@@ -506,7 +506,7 @@ int64_t
 mpegts_service_channel_number ( service_t *s )
 {
   mpegts_service_t *ms = (mpegts_service_t*)s;
-  int r = 0;
+  int64_t r = 0;
 
   if (!ms->s_dvb_mux->mm_network->mn_ignore_chnum) {
     r = ms->s_dvb_channel_num * CHANNEL_SPLIT + ms->s_dvb_channel_minor;