Commit 5f3ca90a authored by François Cartegnie's avatar François Cartegnie 🤞

packetizer: hevc: check id range in getter

parent a3c984ac
......@@ -522,10 +522,22 @@ bool hevc_get_xps_id(const uint8_t *p_buf, size_t i_buf, uint8_t *pi_id)
bs_t bs;
bs_init(&bs, &p_buf[2], i_buf - 2);
if(i_nal_type == HEVC_NAL_PPS)
{
*pi_id = bs_read_ue( &bs );
if(*pi_id > HEVC_PPS_ID_MAX)
return false;
}
else
{
*pi_id = bs_read( &bs, 4 );
if(i_nal_type == HEVC_NAL_SPS)
{
if(*pi_id > HEVC_SPS_ID_MAX)
return false;
}
else if(*pi_id > HEVC_VPS_ID_MAX)
return false;
}
return true;
}
......
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