Commit b297e4d4 authored by Daniel Kamil Kozar's avatar Daniel Kamil Kozar Committed by Jean-Paul Saman

Fix bad operator precedence when reading handover_type in dr-4a generation

Due to the lack of parenthesis, the expression used to read handover_type was
read as (p_descriptor->p_data[7] & (0xF0 >> 4)).

(cherry picked from commit 61bb8944e881d602db9f77a89051ada310958b28)
Signed-off-by: default avatarJean-Paul Saman <jpsaman@videolan.org>
parent 9e9cc85f
......@@ -60,13 +60,13 @@ dvbpsi_linkage_dr_t* dvbpsi_DecodeLinkageDr(dvbpsi_descriptor_t * p_descriptor)
if (p_descriptor->i_length < DR_4A_MIN_SIZE)
return NULL;
int handover_type = 0, origin_type = 0;
unsigned int handover_type = 0, origin_type = 0;
if (p_descriptor->p_data[6] == 0x08)
{
if (p_descriptor->i_length < DR_4A_MIN_SIZE + 1)
return NULL;
handover_type = p_descriptor->p_data[7] & 0xF0 >> 4;
handover_type = (p_descriptor->p_data[7] & 0xF0) >> 4;
origin_type = p_descriptor->p_data[7] & 0x01;
if ((( handover_type > 0 ) && ( handover_type < 4 )
&& ( origin_type == 0 ) && ( p_descriptor->i_length < DR_4A_MIN_SIZE + 5 )) ||
......
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