Browse Source

Append size check in scte35_validate.

In function scte35_validate psi_check_crc call execute without data
size check. The syntax flag in scte35 PSI by definition is false so
psi_validate will be true. In such case scte35_validate may overflow on
zero length PSI size.
master
Nikita Egorov 7 years ago
committed by Christophe Massiot
parent
commit
994814594a
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      scte/35.h

+ 2
- 1
scte/35.h View File

@ -670,7 +670,8 @@ static inline bool scte35_private_validate(const uint8_t *p_scte35)
static inline bool scte35_validate(const uint8_t *p_scte35)
{
if (psi_get_syntax(p_scte35) ||
psi_get_tableid(p_scte35) != SCTE35_TABLE_ID)
psi_get_tableid(p_scte35) != SCTE35_TABLE_ID ||
psi_get_length(p_scte35) < SCTE35_HEADER2_SIZE + PSI_CRC_SIZE)
return false;
if (!psi_check_crc(p_scte35))

Loading…
Cancel
Save