Browse Source

* mpeg/psi.h: Fix an infinite loop when receiving an invalid section.

master
Christophe Massiot 14 years ago
parent
commit
b34ea7f094
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      mpeg/psi.h

+ 5
- 0
mpeg/psi.h View File

@ -539,6 +539,11 @@ static inline uint8_t *psi_assemble_payload(uint8_t **pp_psi_buffer,
uint16_t i_section_size = psi_get_length(*pp_psi_buffer) uint16_t i_section_size = psi_get_length(*pp_psi_buffer)
+ PSI_HEADER_SIZE; + PSI_HEADER_SIZE;
if (i_section_size > PSI_PRIVATE_MAX_SIZE) {
/* invalid section */
psi_assemble_reset(pp_psi_buffer, pi_psi_buffer_used);
return NULL;
}
if (i_section_size <= *pi_psi_buffer_used) { if (i_section_size <= *pi_psi_buffer_used) {
p_section = *pp_psi_buffer; p_section = *pp_psi_buffer;
i_copy_size -= (*pi_psi_buffer_used - i_section_size); i_copy_size -= (*pi_psi_buffer_used - i_section_size);

Loading…
Cancel
Save