Re: TOT CRC Problem
Jean-Paul Saman <[email protected]>
| Newsgroups | gmane.comp.video.videolan.libdvbpsi.devel |
|---|---|
| Message-ID | <CAK9US3DyY4zzdfMMvymHYRYjEKjzULYaq8xEtqREUnX3+c5moQ@mail.gmail.com> |
HI Angelo, Thank you for bringing this to my attention. On Tue, Jan 22, 2013 at 12:20 PM, Angelo Schiavone < [email protected]> wrote: > Hi guys, it's me again. > I found a bug in libdvbpsi TOT table decoding. > Every time a TOT occurres in my transport stream the library throws a CRC > error even if the CRC is correct. > That's because "dvbpsi_ValidPSISection" always return false since TOT > tables have "section_syntax_indicator" set to 0 > but it has a CRC field. > TOT has section_syntax_indicator==0 and CRC field (ETSI EN 300 468 > clause 5.2.6) but the dvbpsi_ValidPSISection function assumes that any table > which have "section_syntax_indicator" set to 0 has no CRC field, thus it > returns false, which comes to TOT crc error. > > Removing this check will break RST, ST and DIT tables, both have section_indicator set to 0 and do not have a CRC32 field. The change should be a little more intelligent, then that and properly reviewed and tested. Kind regards, Jean-Paul Saman. > > bool dvbpsi_ValidPSISection(dvbpsi_psi_section_t* p_section) > > { > > if (p_section->b_syntax_indicator) > > { > > /* Check the CRC_32 if b_syntax_indicator is false */ > > uint32_t i_crc = 0xffffffff; > > uint8_t* p_byte = p_section->p_data; > > while(p_byte < p_section->p_payload_end + 4) > > { > > i_crc = (i_crc << 8) ^ dvbpsi_crc32_table[(i_crc >> 24) ^ (*p_byte)]; > > p_byte++; > > } > > if (i_crc == 0) > > return true; > > else > > return false; > > } > > else > > { > > /* No check to do if b_syntax_indicator is false */ > > return false; > > } > > } > > > > _______________________________________________ > libdvbpsi-devel mailing list > [email protected] > http://mailman.videolan.org/listinfo/libdvbpsi-devel > > _______________________________________________ libdvbpsi-devel mailing list [email protected] http://mailman.videolan.org/listinfo/libdvbpsi-devel