Commit dcc43a21 authored by Jean-Paul Saman's avatar Jean-Paul Saman

SIS: correctly handle pts_adjustment highest bit (CID #17235)

The code meant to move the upmost pts_adjustment bit 33 down to the
lowest bit (bit 1), so it can be or-ed to a byte as lowest bit. However
the first part of the calculation (i_pts_adjustment & 0x00800) had as result
zero. Then shifting it over 32 bit, resulted in still zero. The calculation
was plain wrong.

First shift all bits over 32 to the right. This places bit 33 on bit 1, then
mask out all the other bits and keep bit 1, thus; (i_pts_adjustment >> 32) & 0x01
parent 8a264d9e
...@@ -522,7 +522,7 @@ dvbpsi_psi_section_t *dvbpsi_sis_sections_generate(dvbpsi_t *p_dvbpsi, dvbpsi_si ...@@ -522,7 +522,7 @@ dvbpsi_psi_section_t *dvbpsi_sis_sections_generate(dvbpsi_t *p_dvbpsi, dvbpsi_si
assert(p_sis->b_encrypted_packet); assert(p_sis->b_encrypted_packet);
p_current->p_data[4] |= ((p_sis->i_encryption_algorithm << 1) & 0x7E); p_current->p_data[4] |= ((p_sis->i_encryption_algorithm << 1) & 0x7E);
p_current->p_data[4] |= ((p_sis->i_pts_adjustment & 0x00800) >> 32); p_current->p_data[4] |= ((p_sis->i_pts_adjustment >> 32) & 0x01);
p_current->p_data[5] = (p_sis->i_pts_adjustment >> 24); p_current->p_data[5] = (p_sis->i_pts_adjustment >> 24);
p_current->p_data[6] = (p_sis->i_pts_adjustment >> 16); p_current->p_data[6] = (p_sis->i_pts_adjustment >> 16);
p_current->p_data[7] = (p_sis->i_pts_adjustment >> 8); p_current->p_data[7] = (p_sis->i_pts_adjustment >> 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