Commit b036dc2c authored by Jean-Paul Saman's avatar Jean-Paul Saman

dr_4a: add boundary check

parent c20edafa
...@@ -123,6 +123,8 @@ dvbpsi_linkage_dr_t* dvbpsi_DecodeLinkageDr(dvbpsi_descriptor_t * p_descriptor) ...@@ -123,6 +123,8 @@ dvbpsi_linkage_dr_t* dvbpsi_DecodeLinkageDr(dvbpsi_descriptor_t * p_descriptor)
i = 10; i = 10;
} }
p_decoded->i_private_data_length = p_descriptor->i_length - i; p_decoded->i_private_data_length = p_descriptor->i_length - i;
if (p_decoded->i_private_data_length > 248)
p_decoded->i_private_data_length = 248;
memcpy(p_decoded->i_private_data, &p_descriptor->p_data[i], p_decoded->i_private_data_length); memcpy(p_decoded->i_private_data, &p_descriptor->p_data[i], p_decoded->i_private_data_length);
p_descriptor->p_decoded = (void*)p_decoded; p_descriptor->p_decoded = (void*)p_decoded;
......
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