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
71d3305c
Commit
71d3305c
authored
Mar 21, 2016
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
h264_parse: make sure the ref count is zeroed on all failure paths
parent
a6e27f7a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
h264_parse.c
libavcodec/h264_parse.c
+9
-6
No files found.
libavcodec/h264_parse.c
View file @
71d3305c
...
@@ -194,11 +194,11 @@ int ff_h264_parse_ref_count(int *plist_count, int ref_count[2],
...
@@ -194,11 +194,11 @@ int ff_h264_parse_ref_count(int *plist_count, int ref_count[2],
if
(
num_ref_idx_active_override_flag
)
{
if
(
num_ref_idx_active_override_flag
)
{
ref_count
[
0
]
=
get_ue_golomb
(
gb
)
+
1
;
ref_count
[
0
]
=
get_ue_golomb
(
gb
)
+
1
;
if
(
ref_count
[
0
]
<
1
)
if
(
ref_count
[
0
]
<
1
)
return
AVERROR_INVALIDDATA
;
goto
fail
;
if
(
slice_type_nos
==
AV_PICTURE_TYPE_B
)
{
if
(
slice_type_nos
==
AV_PICTURE_TYPE_B
)
{
ref_count
[
1
]
=
get_ue_golomb
(
gb
)
+
1
;
ref_count
[
1
]
=
get_ue_golomb
(
gb
)
+
1
;
if
(
ref_count
[
1
]
<
1
)
if
(
ref_count
[
1
]
<
1
)
return
AVERROR_INVALIDDATA
;
goto
fail
;
}
}
}
}
...
@@ -213,12 +213,15 @@ int ff_h264_parse_ref_count(int *plist_count, int ref_count[2],
...
@@ -213,12 +213,15 @@ int ff_h264_parse_ref_count(int *plist_count, int ref_count[2],
max_refs
=
picture_structure
==
PICT_FRAME
?
16
:
32
;
max_refs
=
picture_structure
==
PICT_FRAME
?
16
:
32
;
if
(
ref_count
[
0
]
>
max_refs
||
ref_count
[
1
]
>
max_refs
)
{
if
(
ref_count
[
0
]
>
max_refs
||
ref_count
[
1
]
>
max_refs
)
ref_count
[
0
]
=
ref_count
[
1
]
=
0
;
goto
fail
;
return
AVERROR_INVALIDDATA
;
}
*
plist_count
=
list_count
;
*
plist_count
=
list_count
;
return
0
;
return
0
;
fail:
*
plist_count
=
0
;
ref_count
[
0
]
=
0
;
ref_count
[
1
]
=
0
;
return
AVERROR_INVALIDDATA
;
}
}
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