Commit d444eb83 authored by Daniel Kamil Kozar's avatar Daniel Kamil Kozar Committed by Jean-Paul Saman

Fix generation of the parental rating descriptor

Due to scaling the index variable by 8 instead of 4, the generation function of
the parental rating descriptor makes out-of-bounds array accesses.

(cherry picked from commit 0752d56b25f3b2724618de4cd50a11d0f9420af2)
Signed-off-by: Jean-Paul Saman's avatarJean-Paul Saman <jpsaman@videolan.org>
parent 5b84a4c9
......@@ -112,14 +112,14 @@ dvbpsi_descriptor_t * dvbpsi_GenParentalRatingDr(
/* Encode data */
for (int i = 0; i < p_decoded->i_ratings_number; i++ )
{
p_descriptor->p_data[8 * i] =
p_descriptor->p_data[4 * i] =
p_decoded->p_parental_rating[i].i_country_code >> 16;
p_descriptor->p_data[8 * i + 1] =
p_descriptor->p_data[4 * i + 1] =
(p_decoded->p_parental_rating[i].i_country_code >> 8) & 0xff;
p_descriptor->p_data[8 * i + 2] =
p_descriptor->p_data[4 * i + 2] =
p_decoded->p_parental_rating[i].i_country_code & 0xff;
p_descriptor->p_data[8 * i + 3] =
p_descriptor->p_data[4 * i + 3] =
p_decoded->p_parental_rating[i].i_rating;
}
......
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