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
86d5fe68
Commit
86d5fe68
authored
Mar 20, 2013
by
Jean-Paul Saman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dr_58: add boundary checking
parent
709f80dd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
+16
-2
src/descriptors/dr_58.c
src/descriptors/dr_58.c
+8
-0
src/descriptors/dr_58.h
src/descriptors/dr_58.h
+8
-2
No files found.
src/descriptors/dr_58.c
View file @
86d5fe68
...
...
@@ -84,7 +84,12 @@ dvbpsi_local_time_offset_dr_t * dvbpsi_DecodeLocalTimeOffsetDr(
p_current
->
i_next_time_offset
=
((
uint16_t
)
p_data
[
11
]
<<
8
)
|
(
uint16_t
)
p_data
[
12
];
/* NOTE: Only decode upto DVBPSI_LOCAL_TIME_OFFSET_DR_MAX number of time
offsets. The decoding struct cannot hold more then that. */
p_decoded
->
i_local_time_offsets_number
++
;
if
(
p_decoded
->
i_local_time_offsets_number
==
DVBPSI_LOCAL_TIME_OFFSET_DR_MAX
)
break
;
p_data
+=
13
;
p_current
++
;
}
...
...
@@ -101,6 +106,9 @@ dvbpsi_descriptor_t * dvbpsi_GenLocalTimeOffsetDr(
dvbpsi_local_time_offset_dr_t
*
p_decoded
,
bool
b_duplicate
)
{
if
(
p_decoded
->
i_local_time_offsets_number
>
DVBPSI_LOCAL_TIME_OFFSET_DR_MAX
)
p_decoded
->
i_local_time_offsets_number
=
DVBPSI_LOCAL_TIME_OFFSET_DR_MAX
;
/* Create the descriptor */
dvbpsi_descriptor_t
*
p_descriptor
=
dvbpsi_NewDescriptor
(
0x58
,
p_decoded
->
i_local_time_offsets_number
*
13
,
NULL
);
...
...
src/descriptors/dr_58.h
View file @
86d5fe68
...
...
@@ -65,6 +65,12 @@ typedef struct dvbpsi_local_time_offset_s
}
dvbpsi_local_time_offset_t
;
/*!
* \def DVBPSI_LOCAL_TIME_OFFSET_DR_MAX
* \brief Maximum number of dvbpsi_local_time_offset_t entries present in
* @see dvbpsi_local_time_offset_dr_t
*/
#define DVBPSI_LOCAL_TIME_OFFSET_DR_MAX 19
/*****************************************************************************
* dvbpsi_local_time_offset_dr_t
...
...
@@ -83,11 +89,11 @@ typedef struct dvbpsi_local_time_offset_s
typedef
struct
dvbpsi_local_time_offset_dr_s
{
uint8_t
i_local_time_offsets_number
;
/*!< local time offset number */
dvbpsi_local_time_offset_t
p_local_time_offset
[
19
];
/*!< local time offset */
dvbpsi_local_time_offset_t
p_local_time_offset
[
DVBPSI_LOCAL_TIME_OFFSET_DR_MAX
];
/*!< local time offset */
}
dvbpsi_local_time_offset_dr_t
;
/*****************************************************************************
* dvbpsi_DecodeLocalTimeOffsetDr
*****************************************************************************/
...
...
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