Bug #2115
closedcat: invalid length
100%
Description
In the current code the cat_callback requires a minimum of 7 bytes of data else it throws an error in the dvb_table_begin sub method.
dvb_cat_callback...
/* Start */
r = dvb_table_begin(mt, ptr, len, tableid, 0, 7, &st, §, &last, &ver);
I have an example of provider not setting any a descriptor() in the table at all (i.e. N=0). Thus the total length from the section_length to the end of the CRC is 9 bytes (section_length is set to 0x009 : 12 bits in the cat table from dvbsnoop extract)
transport_stream_id:16 bits
reserved: 2 bits
version_number: 5 bits
current_next_indicator: 1 bits
section_number: 8 bits
last_section_number: 8 bits
for i = 0 to N
descriptor() var (0 bits)
next
CRC_32: 32 bits
= 9 bytes
Removing the 4 byte CRC gives a minimum of 5 bytes for the table with no descriptor().
To avoid the error dvb_table_begin minlength for dvb_cat_callback should be reduced to 5
Phill