TOT CRC Problem

Angelo Schiavone <[email protected]>
Newsgroups gmane.comp.video.videolan.libdvbpsi.devel
Message-ID <CADyCdYeXt4TbD3mnCYK+jP_8cpMBeAOif4BgZ90BrvCRnFTdVA@mail.gmail.com>
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.


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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.