Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
0d8b943d
Commit
0d8b943d
authored
Aug 02, 2013
by
Vittorio Giovara
Committed by
Diego Biurrun
Aug 02, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
h264_sei: Return meaningful values
Signed-off-by:
Diego Biurrun
<
diego@biurrun.de
>
parent
b1841217
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
11 deletions
+16
-11
h264_sei.c
libavcodec/h264_sei.c
+16
-11
No files found.
libavcodec/h264_sei.c
View file @
0d8b943d
...
...
@@ -61,7 +61,7 @@ static int decode_picture_timing(H264Context *h)
h
->
sei_ct_type
=
0
;
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
];
...
...
@@ -109,7 +109,7 @@ static int decode_unregistered_user_data(H264Context *h, int size)
int
e
,
build
,
i
;
if
(
size
<
16
)
return
-
1
;
return
AVERROR_INVALIDDATA
;
for
(
i
=
0
;
i
<
sizeof
(
user_data
)
-
1
&&
i
<
size
;
i
++
)
user_data
[
i
]
=
get_bits
(
&
h
->
gb
,
8
);
...
...
@@ -150,7 +150,7 @@ static int decode_buffering_period(H264Context *h)
if
(
sps_id
>
31
||
!
h
->
sps_buffers
[
sps_id
])
{
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"non-existing SPS %d referenced in buffering period
\n
"
,
sps_id
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
sps
=
h
->
sps_buffers
[
sps_id
];
...
...
@@ -181,6 +181,7 @@ int ff_h264_decode_sei(H264Context *h)
while
(
get_bits_left
(
&
h
->
gb
)
>
16
)
{
int
size
=
0
;
int
type
=
0
;
int
ret
=
0
;
do
type
+=
show_bits
(
&
h
->
gb
,
8
);
...
...
@@ -192,20 +193,24 @@ int ff_h264_decode_sei(H264Context *h)
switch
(
type
)
{
case
SEI_TYPE_PIC_TIMING
:
// Picture timing SEI
if
(
decode_picture_timing
(
h
)
<
0
)
return
-
1
;
ret
=
decode_picture_timing
(
h
);
if
(
ret
<
0
)
return
ret
;
break
;
case
SEI_TYPE_USER_DATA_UNREGISTERED
:
if
(
decode_unregistered_user_data
(
h
,
size
)
<
0
)
return
-
1
;
ret
=
decode_unregistered_user_data
(
h
,
size
);
if
(
ret
<
0
)
return
ret
;
break
;
case
SEI_TYPE_RECOVERY_POINT
:
if
(
decode_recovery_point
(
h
)
<
0
)
return
-
1
;
ret
=
decode_recovery_point
(
h
);
if
(
ret
<
0
)
return
ret
;
break
;
case
SEI_BUFFERING_PERIOD
:
if
(
decode_buffering_period
(
h
)
<
0
)
return
-
1
;
ret
=
decode_buffering_period
(
h
);
if
(
ret
<
0
)
return
ret
;
break
;
default:
skip_bits
(
&
h
->
gb
,
8
*
size
);
...
...
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