Commit 752b3e28 authored by Jean-Paul Saman's avatar Jean-Paul Saman

dr_55.c: Fix CID #17250

parent dc606120
......@@ -92,13 +92,19 @@ dvbpsi_parental_rating_dr_t * dvbpsi_DecodeParentalRatingDr(
dvbpsi_descriptor_t * dvbpsi_GenParentalRatingDr(
dvbpsi_parental_rating_dr_t * p_decoded,
bool b_duplicate)
{
if (p_decoded->i_ratings_number > DVBPSI_PARENTAL_RATING_DR_MAX)
{
uint8_t i_length;
if (p_decoded->i_ratings_number >= DVBPSI_PARENTAL_RATING_DR_MAX)
{
i_length = (DVBPSI_PARENTAL_RATING_DR_MAX - 1) * 4;
p_decoded->i_ratings_number = DVBPSI_PARENTAL_RATING_DR_MAX;
}
else
i_length = p_decoded->i_ratings_number * 4;
/* Create the descriptor */
dvbpsi_descriptor_t * p_descriptor =
dvbpsi_NewDescriptor(0x55, p_decoded->i_ratings_number * 4 , NULL);
dvbpsi_NewDescriptor(0x55, i_length, NULL);
if (!p_descriptor)
return NULL;
......
......@@ -67,7 +67,7 @@ typedef struct dvbpsi_teletextpage_s
* \brief Maximum number of dvbpsi_teletextpage_t entries present in
* @see dvbpsi_teletext_dr_t
*/
#define DVBPSI_TELETEXT_DR_MAX 64
#define DVBPSI_TELETEXT_DR_MAX 51
/*****************************************************************************
* dvbpsi_teletext_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