Commit 8d3d27eb authored by Jean-Paul Saman's avatar Jean-Paul Saman

dr_48.c: Fix Fix CID #17251

parent 752b3e28
......@@ -116,10 +116,14 @@ dvbpsi_descriptor_t * dvbpsi_GenServiceDr(dvbpsi_service_dr_t * p_decoded,
if (p_decoded->i_service_name_length > 252)
p_decoded->i_service_name_length = 252;
/* FIXME: is this correct? A descriptor cannot be more then 255 bytes due to
* the function prototype definition */
uint8_t i_size = 0;
int i_length = 3 + p_decoded->i_service_name_length + p_decoded->i_service_provider_name_length;
i_size = (i_length >= UINT8_MAX) ? 255 : i_length;
/* Create the descriptor */
dvbpsi_descriptor_t * p_descriptor =
dvbpsi_NewDescriptor(0x48, 3 + p_decoded->i_service_name_length +
p_decoded->i_service_provider_name_length, NULL);
dvbpsi_descriptor_t *p_descriptor = dvbpsi_NewDescriptor(0x48, i_size, NULL);
if (!p_descriptor)
return NULL;
......
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