Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Steve Lhomme
VLC
Commits
c4cd717e
Commit
c4cd717e
authored
Dec 06, 2015
by
François Cartegnie
🤞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
packetizer: h264: fix early fail condition
sps id can obviously never be negative
parent
60051758
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
modules/packetizer/h264_nal.c
modules/packetizer/h264_nal.c
+3
-1
No files found.
modules/packetizer/h264_nal.c
View file @
c4cd717e
...
@@ -427,6 +427,8 @@ int h264_parse_sps( const uint8_t *p_sps_buf, int i_sps_size,
...
@@ -427,6 +427,8 @@ int h264_parse_sps( const uint8_t *p_sps_buf, int i_sps_size,
memset
(
p_sps
,
0
,
sizeof
(
struct
nal_sps
)
);
memset
(
p_sps
,
0
,
sizeof
(
struct
nal_sps
)
);
CreateRbspFromNAL
(
&
pb_dec
,
&
i_dec
,
&
p_sps_buf
[
5
],
CreateRbspFromNAL
(
&
pb_dec
,
&
i_dec
,
&
p_sps_buf
[
5
],
i_sps_size
-
5
);
i_sps_size
-
5
);
if
(
!
pb_dec
)
return
-
1
;
bs_init
(
&
s
,
pb_dec
,
i_dec
);
bs_init
(
&
s
,
pb_dec
,
i_dec
);
int
i_profile_idc
=
bs_read
(
&
s
,
8
);
int
i_profile_idc
=
bs_read
(
&
s
,
8
);
...
@@ -435,7 +437,7 @@ int h264_parse_sps( const uint8_t *p_sps_buf, int i_sps_size,
...
@@ -435,7 +437,7 @@ int h264_parse_sps( const uint8_t *p_sps_buf, int i_sps_size,
p_sps
->
i_level
=
bs_read
(
&
s
,
8
);
p_sps
->
i_level
=
bs_read
(
&
s
,
8
);
/* sps id */
/* sps id */
p_sps
->
i_id
=
bs_read_ue
(
&
s
);
p_sps
->
i_id
=
bs_read_ue
(
&
s
);
if
(
p_sps
->
i_id
>=
SPS_MAX
||
p_sps
->
i_id
<
0
)
if
(
p_sps
->
i_id
>=
SPS_MAX
)
{
{
free
(
pb_dec
);
free
(
pb_dec
);
return
-
1
;
return
-
1
;
...
...
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