Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libdvbpsi
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
libdvbpsi
Commits
e9df3130
Commit
e9df3130
authored
Mar 20, 2013
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dr_55: Add boundary checking.
parent
c810f7d7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
src/descriptors/dr_55.c
src/descriptors/dr_55.c
+6
-1
src/descriptors/dr_55.h
src/descriptors/dr_55.h
+8
-1
No files found.
src/descriptors/dr_55.c
View file @
e9df3130
...
...
@@ -66,6 +66,8 @@ dvbpsi_parental_rating_dr_t * dvbpsi_DecodeParentalRatingDr(
return
NULL
;
int
i_ratings_number
=
p_descriptor
->
i_length
/
4
;
if
(
i_ratings_number
>
DVBPSI_PARENTAL_RATING_DR_MAX
)
i_ratings_number
=
DVBPSI_PARENTAL_RATING_DR_MAX
;
p_decoded
->
i_ratings_number
=
i_ratings_number
;
for
(
int
i
=
0
;
i
<
i_ratings_number
;
i
++
)
...
...
@@ -90,7 +92,10 @@ dvbpsi_parental_rating_dr_t * dvbpsi_DecodeParentalRatingDr(
dvbpsi_descriptor_t
*
dvbpsi_GenParentalRatingDr
(
dvbpsi_parental_rating_dr_t
*
p_decoded
,
bool
b_duplicate
)
{
{
if
(
p_decoded
->
i_ratings_number
>
DVBPSI_PARENTAL_RATING_DR_MAX
)
p_decoded
->
i_ratings_number
=
DVBPSI_PARENTAL_RATING_DR_MAX
;
/* Create the descriptor */
dvbpsi_descriptor_t
*
p_descriptor
=
dvbpsi_NewDescriptor
(
0x55
,
p_decoded
->
i_ratings_number
*
4
,
NULL
);
...
...
src/descriptors/dr_55.h
View file @
e9df3130
...
...
@@ -58,6 +58,12 @@ typedef struct dvbpsi_parental_rating_s
}
dvbpsi_parental_rating_t
;
/*!
* \def DVBPSI_PARENTAL_RATING_DR_MAX
* \brief Maximum number of dvbpsi_parental_rating_t entries present in
* @see dvbpsi_parental_rating_t
*/
#define DVBPSI_PARENTAL_RATING_DR_MAX 64
/*****************************************************************************
* dvbpsi_parental_rating_dr_t
...
...
@@ -76,7 +82,8 @@ typedef struct dvbpsi_parental_rating_s
typedef
struct
dvbpsi_parental_rating_dr_s
{
uint8_t
i_ratings_number
;
/*!< number of rating */
dvbpsi_parental_rating_t
p_parental_rating
[
64
];
/*!< parental rating table */
dvbpsi_parental_rating_t
p_parental_rating
[
DVBPSI_PARENTAL_RATING_DR_MAX
];
/*!< parental rating table */
}
dvbpsi_parental_rating_dr_t
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment