Commit b34ea7f0 authored by Christophe Massiot's avatar Christophe Massiot

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

parent 8154e00f
...@@ -539,6 +539,11 @@ static inline uint8_t *psi_assemble_payload(uint8_t **pp_psi_buffer, ...@@ -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);
......
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