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
709f80dd
Commit
709f80dd
authored
Mar 20, 2013
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dr_59: Add boundary checking.
parent
b9755cd0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
src/descriptors/dr_59.c
src/descriptors/dr_59.c
+5
-1
src/descriptors/dr_59.h
src/descriptors/dr_59.h
+7
-1
No files found.
src/descriptors/dr_59.c
View file @
709f80dd
...
@@ -72,7 +72,8 @@ dvbpsi_subtitling_dr_t * dvbpsi_DecodeSubtitlingDr(
...
@@ -72,7 +72,8 @@ dvbpsi_subtitling_dr_t * dvbpsi_DecodeSubtitlingDr(
return
NULL
;
return
NULL
;
i_subtitles_number
=
p_descriptor
->
i_length
/
8
;
i_subtitles_number
=
p_descriptor
->
i_length
/
8
;
if
(
i_subtitles_number
>
DVBPSI_SUBTITLING_DR_MAX
)
i_subtitles_number
=
DVBPSI_SUBTITLING_DR_MAX
;
p_decoded
->
i_subtitles_number
=
i_subtitles_number
;
p_decoded
->
i_subtitles_number
=
i_subtitles_number
;
for
(
int
i
=
0
;
i
<
i_subtitles_number
;
i
++
)
for
(
int
i
=
0
;
i
<
i_subtitles_number
;
i
++
)
...
@@ -105,6 +106,9 @@ dvbpsi_descriptor_t * dvbpsi_GenSubtitlingDr(
...
@@ -105,6 +106,9 @@ dvbpsi_descriptor_t * dvbpsi_GenSubtitlingDr(
dvbpsi_subtitling_dr_t
*
p_decoded
,
dvbpsi_subtitling_dr_t
*
p_decoded
,
bool
b_duplicate
)
bool
b_duplicate
)
{
{
if
(
p_decoded
->
i_subtitles_number
>
DVBPSI_SUBTITLING_DR_MAX
)
p_decoded
->
i_subtitles_number
=
DVBPSI_SUBTITLING_DR_MAX
;
/* Create the descriptor */
/* Create the descriptor */
dvbpsi_descriptor_t
*
p_descriptor
=
dvbpsi_descriptor_t
*
p_descriptor
=
dvbpsi_NewDescriptor
(
0x59
,
p_decoded
->
i_subtitles_number
*
8
,
NULL
);
dvbpsi_NewDescriptor
(
0x59
,
p_decoded
->
i_subtitles_number
*
8
,
NULL
);
...
...
src/descriptors/dr_59.h
View file @
709f80dd
...
@@ -61,6 +61,12 @@ typedef struct dvbpsi_subtitle_s
...
@@ -61,6 +61,12 @@ typedef struct dvbpsi_subtitle_s
}
dvbpsi_subtitle_t
;
}
dvbpsi_subtitle_t
;
/*!
* \def DVBPSI_SUBTITLING_DR_MAX
* \brief Maximum number of dvbpsi_subtitle_t entries present in
* @see dvbpsi_subtitling_dr_t
*/
#define DVBPSI_SUBTITLING_DR_MAX 20
/*****************************************************************************
/*****************************************************************************
* dvbpsi_subtitling_dr_t
* dvbpsi_subtitling_dr_t
...
@@ -79,7 +85,7 @@ typedef struct dvbpsi_subtitle_s
...
@@ -79,7 +85,7 @@ typedef struct dvbpsi_subtitle_s
typedef
struct
dvbpsi_subtitling_dr_s
typedef
struct
dvbpsi_subtitling_dr_s
{
{
uint8_t
i_subtitles_number
;
/*!< subtiles number */
uint8_t
i_subtitles_number
;
/*!< subtiles number */
dvbpsi_subtitle_t
p_subtitle
[
20
];
/*!< subtitles */
dvbpsi_subtitle_t
p_subtitle
[
DVBPSI_SUBTITLING_DR_MAX
];
/*!< subtitles */
}
dvbpsi_subtitling_dr_t
;
}
dvbpsi_subtitling_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