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

descriptor: 0x41: correct max service count

parent fe26249a
...@@ -39,6 +39,8 @@ ...@@ -39,6 +39,8 @@
#include "dr_41.h" #include "dr_41.h"
#define DVBPSI_SLS_DR_MAX (84)
/***************************************************************************** /*****************************************************************************
* dvbpsi_decode_dvb_service_list_dr * dvbpsi_decode_dvb_service_list_dr
*****************************************************************************/ *****************************************************************************/
...@@ -59,7 +61,7 @@ dvbpsi_dvb_service_list_dr_t* dvbpsi_decode_dvb_service_list_dr( ...@@ -59,7 +61,7 @@ dvbpsi_dvb_service_list_dr_t* dvbpsi_decode_dvb_service_list_dr(
unsigned int service_count = p_descriptor->i_length / 3; unsigned int service_count = p_descriptor->i_length / 3;
if ((p_descriptor->i_length < 1) || if ((p_descriptor->i_length < 1) ||
(p_descriptor->i_length % 3 != 0) || (p_descriptor->i_length % 3 != 0) ||
(service_count>63)) (service_count > DVBPSI_SLS_DR_MAX - 1))
return NULL; return NULL;
/* Allocate memory */ /* Allocate memory */
...@@ -91,7 +93,7 @@ dvbpsi_descriptor_t * dvbpsi_gen_dvb_service_list_dr( ...@@ -91,7 +93,7 @@ dvbpsi_descriptor_t * dvbpsi_gen_dvb_service_list_dr(
bool b_duplicate) bool b_duplicate)
{ {
/* Check the length */ /* Check the length */
if (p_decoded->i_service_count > 63) if (p_decoded->i_service_count > DVBPSI_SLS_DR_MAX - 1)
return NULL; return NULL;
/* Create the descriptor */ /* Create the descriptor */
......
...@@ -59,7 +59,7 @@ typedef struct dvbpsi_dvb_service_list_dr_s ...@@ -59,7 +59,7 @@ typedef struct dvbpsi_dvb_service_list_dr_s
struct dvbpsi_service_list_service_s { struct dvbpsi_service_list_service_s {
uint16_t i_service_id; /*!< service id */ uint16_t i_service_id; /*!< service id */
uint8_t i_service_type; /*!< service type */ uint8_t i_service_type; /*!< service type */
} i_service[64]; /*!< array of services */ } i_service[84]; /*!< array of services */
} dvbpsi_dvb_service_list_dr_t; } dvbpsi_dvb_service_list_dr_t;
......
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