Commit 00af91a2 authored by Jean-Paul Saman's avatar Jean-Paul Saman

src/dvbpsi.c: b_syntax_indicator and i_table_id were used before being initialized.

parent 6e0c0008
...@@ -404,13 +404,15 @@ bool dvbpsi_packet_push(dvbpsi_t *p_dvbpsi, uint8_t* p_data) ...@@ -404,13 +404,15 @@ bool dvbpsi_packet_push(dvbpsi_t *p_dvbpsi, uint8_t* p_data)
else else
{ {
bool b_valid_crc32 = false; bool b_valid_crc32 = false;
bool has_crc32 = dvbpsi_has_CRC32(p_section); bool has_crc32;
/* PSI section is complete */ /* PSI section is complete */
p_section->i_table_id = p_section->p_data[0];
p_section->b_syntax_indicator = p_section->p_data[1] & 0x80; p_section->b_syntax_indicator = p_section->p_data[1] & 0x80;
p_section->b_private_indicator = p_section->p_data[1] & 0x40; p_section->b_private_indicator = p_section->p_data[1] & 0x40;
/* Update the end of the payload if CRC_32 is present */ /* Update the end of the payload if CRC_32 is present */
has_crc32 = dvbpsi_has_CRC32(p_section);
if (p_section->b_syntax_indicator || has_crc32) if (p_section->b_syntax_indicator || has_crc32)
p_section->p_payload_end -= 4; p_section->p_payload_end -= 4;
...@@ -421,7 +423,6 @@ bool dvbpsi_packet_push(dvbpsi_t *p_dvbpsi, uint8_t* p_data) ...@@ -421,7 +423,6 @@ bool dvbpsi_packet_push(dvbpsi_t *p_dvbpsi, uint8_t* p_data)
if (!has_crc32 || b_valid_crc32) if (!has_crc32 || b_valid_crc32)
{ {
/* PSI section is valid */ /* PSI section is valid */
p_section->i_table_id = p_section->p_data[0];
if (p_section->b_syntax_indicator) if (p_section->b_syntax_indicator)
{ {
p_section->i_extension = (p_section->p_data[3] << 8) p_section->i_extension = (p_section->p_data[3] << 8)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment