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
dc9ce400
Commit
dc9ce400
authored
Sep 28, 2011
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
h264: More correct ref_count check in decode_slice_header()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
514c44c4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
h264.c
libavcodec/h264.c
+6
-5
No files found.
libavcodec/h264.c
View file @
dc9ce400
...
...
@@ -2881,6 +2881,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
h
->
ref_count
[
1
]
=
h
->
pps
.
ref_count
[
1
];
if
(
h
->
slice_type_nos
!=
AV_PICTURE_TYPE_I
){
unsigned
max
=
(
16
<<
(
s
->
picture_structure
!=
PICT_FRAME
))
-
1
;
if
(
h
->
slice_type_nos
==
AV_PICTURE_TYPE_B
){
h
->
direct_spatial_mv_pred
=
get_bits1
(
&
s
->
gb
);
}
...
...
@@ -2891,11 +2892,11 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
if
(
h
->
slice_type_nos
==
AV_PICTURE_TYPE_B
)
h
->
ref_count
[
1
]
=
get_ue_golomb
(
&
s
->
gb
)
+
1
;
if
(
h
->
ref_count
[
0
]
-
1
>
32
-
1
||
h
->
ref_count
[
1
]
-
1
>
32
-
1
){
av_log
(
h
->
s
.
avctx
,
AV_LOG_ERROR
,
"reference overflow
\n
"
);
h
->
ref_count
[
0
]
=
h
->
ref_count
[
1
]
=
1
;
return
-
1
;
}
}
if
(
h
->
ref_count
[
0
]
-
1
>
max
||
h
->
ref_count
[
1
]
-
1
>
max
){
av_log
(
h
->
s
.
avctx
,
AV_LOG_ERROR
,
"reference overflow
\n
"
)
;
h
->
ref_count
[
0
]
=
h
->
ref_count
[
1
]
=
1
;
return
-
1
;
}
if
(
h
->
slice_type_nos
==
AV_PICTURE_TYPE_B
)
h
->
list_count
=
2
;
...
...
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