Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
bitstream
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
bitstream
Commits
612e3dea
Commit
612e3dea
authored
May 13, 2011
by
Christophe Massiot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* dvb/sim.h: Fix compilation warnings. * examples/dvb_ecmg.c: Fix segfault.
parent
a2cc3895
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
dvb/sim.h
dvb/sim.h
+4
-4
examples/dvb_ecmg.c
examples/dvb_ecmg.c
+5
-3
No files found.
dvb/sim.h
View file @
612e3dea
...
@@ -48,7 +48,7 @@ static inline void tlvh_set_version(uint8_t *p_tlv, uint8_t i_version)
...
@@ -48,7 +48,7 @@ static inline void tlvh_set_version(uint8_t *p_tlv, uint8_t i_version)
p_tlv
[
0
]
=
i_version
;
p_tlv
[
0
]
=
i_version
;
}
}
static
inline
uint8_t
tlvh_get_version
(
uint8_t
*
p_tlv
)
static
inline
uint8_t
tlvh_get_version
(
const
uint8_t
*
p_tlv
)
{
{
return
p_tlv
[
0
];
return
p_tlv
[
0
];
}
}
...
@@ -64,7 +64,7 @@ static inline void tlv_set_type(uint8_t *p_tlv, uint16_t i_type)
...
@@ -64,7 +64,7 @@ static inline void tlv_set_type(uint8_t *p_tlv, uint16_t i_type)
p_tlv
[
1
]
=
i_type
&
0xff
;
p_tlv
[
1
]
=
i_type
&
0xff
;
}
}
static
inline
uint16_t
tlv_get_type
(
uint8_t
*
p_tlv
)
static
inline
uint16_t
tlv_get_type
(
const
uint8_t
*
p_tlv
)
{
{
return
(
p_tlv
[
0
]
<<
8
)
|
p_tlv
[
1
];
return
(
p_tlv
[
0
]
<<
8
)
|
p_tlv
[
1
];
}
}
...
@@ -75,7 +75,7 @@ static inline void tlv_set_length(uint8_t *p_tlv, uint16_t i_length)
...
@@ -75,7 +75,7 @@ static inline void tlv_set_length(uint8_t *p_tlv, uint16_t i_length)
p_tlv
[
3
]
=
i_length
&
0xff
;
p_tlv
[
3
]
=
i_length
&
0xff
;
}
}
static
inline
uint16_t
tlv_get_length
(
uint8_t
*
p_tlv
)
static
inline
uint16_t
tlv_get_length
(
const
uint8_t
*
p_tlv
)
{
{
return
(
p_tlv
[
2
]
<<
8
)
|
p_tlv
[
3
];
return
(
p_tlv
[
2
]
<<
8
)
|
p_tlv
[
3
];
}
}
...
@@ -161,7 +161,7 @@ static inline uint16_t tlv_count_param(uint8_t *p_tlv, uint16_t i_type)
...
@@ -161,7 +161,7 @@ static inline uint16_t tlv_count_param(uint8_t *p_tlv, uint16_t i_type)
}
}
static
inline
bool
tlv_validate_count_param
(
uint8_t
*
p_tlv
,
static
inline
bool
tlv_validate_count_param
(
uint8_t
*
p_tlv
,
tlv_param_count_t
*
p_count
)
const
tlv_param_count_t
*
p_count
)
{
{
uint16_t
i_count
=
tlv_count_param
(
p_tlv
,
p_count
->
i_type
);
uint16_t
i_count
=
tlv_count_param
(
p_tlv
,
p_count
->
i_type
);
return
(
i_count
>=
p_count
->
i_min
)
&&
(
i_count
<=
p_count
->
i_max
);
return
(
i_count
>=
p_count
->
i_min
)
&&
(
i_count
<=
p_count
->
i_max
);
...
...
examples/dvb_ecmg.c
View file @
612e3dea
...
@@ -450,14 +450,16 @@ static void handle_stream_setup(uint8_t *p_tlv)
...
@@ -450,14 +450,16 @@ static void handle_stream_setup(uint8_t *p_tlv)
return
;
return
;
}
}
p_stream
=
malloc
(
sizeof
(
stream_t
));
for
(
i
=
0
;
i
<
i_nb_streams
;
i
++
)
{
for
(
i
=
0
;
i
<
i_nb_streams
;
i
++
)
{
p_stream
=
pp_streams
[
i
];
if
(
pp_streams
[
i
]
==
NULL
)
{
if
(
p_stream
==
NULL
)
pp_streams
[
i
]
=
p_stream
;
break
;
break
;
}
}
}
if
(
i
==
i_nb_streams
)
{
if
(
i
==
i_nb_streams
)
{
p_stream
=
malloc
(
sizeof
(
stream_t
));
pp_streams
=
realloc
(
pp_streams
,
++
i_nb_streams
*
sizeof
(
stream_t
*
));
pp_streams
=
realloc
(
pp_streams
,
++
i_nb_streams
*
sizeof
(
stream_t
*
));
pp_streams
[
i_nb_streams
-
1
]
=
p_stream
;
pp_streams
[
i_nb_streams
-
1
]
=
p_stream
;
}
}
...
...
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