Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
0d8b943d
Commit
0d8b943d
authored
11 years ago
by
Vittorio Giovara
Committed by
Diego Biurrun
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
h264_sei: Return meaningful values
Signed-off-by:
Diego Biurrun
<
diego@biurrun.de
>
parent
b1841217
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libavcodec/h264_sei.c
+16
-11
16 additions, 11 deletions
libavcodec/h264_sei.c
with
16 additions
and
11 deletions
libavcodec/h264_sei.c
+
16
−
11
View file @
0d8b943d
...
@@ -61,7 +61,7 @@ static int decode_picture_timing(H264Context *h)
...
@@ -61,7 +61,7 @@ static int decode_picture_timing(H264Context *h)
h
->
sei_ct_type
=
0
;
h
->
sei_ct_type
=
0
;
if
(
h
->
sei_pic_struct
>
SEI_PIC_STRUCT_FRAME_TRIPLING
)
if
(
h
->
sei_pic_struct
>
SEI_PIC_STRUCT_FRAME_TRIPLING
)
return
-
1
;
return
AVERROR_INVALIDDATA
;
num_clock_ts
=
sei_num_clock_ts_table
[
h
->
sei_pic_struct
];
num_clock_ts
=
sei_num_clock_ts_table
[
h
->
sei_pic_struct
];
...
@@ -109,7 +109,7 @@ static int decode_unregistered_user_data(H264Context *h, int size)
...
@@ -109,7 +109,7 @@ static int decode_unregistered_user_data(H264Context *h, int size)
int
e
,
build
,
i
;
int
e
,
build
,
i
;
if
(
size
<
16
)
if
(
size
<
16
)
return
-
1
;
return
AVERROR_INVALIDDATA
;
for
(
i
=
0
;
i
<
sizeof
(
user_data
)
-
1
&&
i
<
size
;
i
++
)
for
(
i
=
0
;
i
<
sizeof
(
user_data
)
-
1
&&
i
<
size
;
i
++
)
user_data
[
i
]
=
get_bits
(
&
h
->
gb
,
8
);
user_data
[
i
]
=
get_bits
(
&
h
->
gb
,
8
);
...
@@ -150,7 +150,7 @@ static int decode_buffering_period(H264Context *h)
...
@@ -150,7 +150,7 @@ static int decode_buffering_period(H264Context *h)
if
(
sps_id
>
31
||
!
h
->
sps_buffers
[
sps_id
])
{
if
(
sps_id
>
31
||
!
h
->
sps_buffers
[
sps_id
])
{
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"non-existing SPS %d referenced in buffering period
\n
"
,
sps_id
);
"non-existing SPS %d referenced in buffering period
\n
"
,
sps_id
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
}
sps
=
h
->
sps_buffers
[
sps_id
];
sps
=
h
->
sps_buffers
[
sps_id
];
...
@@ -181,6 +181,7 @@ int ff_h264_decode_sei(H264Context *h)
...
@@ -181,6 +181,7 @@ int ff_h264_decode_sei(H264Context *h)
while
(
get_bits_left
(
&
h
->
gb
)
>
16
)
{
while
(
get_bits_left
(
&
h
->
gb
)
>
16
)
{
int
size
=
0
;
int
size
=
0
;
int
type
=
0
;
int
type
=
0
;
int
ret
=
0
;
do
do
type
+=
show_bits
(
&
h
->
gb
,
8
);
type
+=
show_bits
(
&
h
->
gb
,
8
);
...
@@ -192,20 +193,24 @@ int ff_h264_decode_sei(H264Context *h)
...
@@ -192,20 +193,24 @@ int ff_h264_decode_sei(H264Context *h)
switch
(
type
)
{
switch
(
type
)
{
case
SEI_TYPE_PIC_TIMING
:
// Picture timing SEI
case
SEI_TYPE_PIC_TIMING
:
// Picture timing SEI
if
(
decode_picture_timing
(
h
)
<
0
)
ret
=
decode_picture_timing
(
h
);
return
-
1
;
if
(
ret
<
0
)
return
ret
;
break
;
break
;
case
SEI_TYPE_USER_DATA_UNREGISTERED
:
case
SEI_TYPE_USER_DATA_UNREGISTERED
:
if
(
decode_unregistered_user_data
(
h
,
size
)
<
0
)
ret
=
decode_unregistered_user_data
(
h
,
size
);
return
-
1
;
if
(
ret
<
0
)
return
ret
;
break
;
break
;
case
SEI_TYPE_RECOVERY_POINT
:
case
SEI_TYPE_RECOVERY_POINT
:
if
(
decode_recovery_point
(
h
)
<
0
)
ret
=
decode_recovery_point
(
h
);
return
-
1
;
if
(
ret
<
0
)
return
ret
;
break
;
break
;
case
SEI_BUFFERING_PERIOD
:
case
SEI_BUFFERING_PERIOD
:
if
(
decode_buffering_period
(
h
)
<
0
)
ret
=
decode_buffering_period
(
h
);
return
-
1
;
if
(
ret
<
0
)
return
ret
;
break
;
break
;
default:
default:
skip_bits
(
&
h
->
gb
,
8
*
size
);
skip_bits
(
&
h
->
gb
,
8
*
size
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment