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
c3bd306e
Commit
c3bd306e
authored
Apr 30, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
h264_ps: check croping values
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
7edb984d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
h264_ps.c
libavcodec/h264_ps.c
+13
-0
No files found.
libavcodec/h264_ps.c
View file @
c3bd306e
...
...
@@ -463,6 +463,8 @@ int ff_h264_decode_seq_parameter_set(H264Context *h){
int
crop_right
=
get_ue_golomb
(
&
h
->
gb
);
int
crop_top
=
get_ue_golomb
(
&
h
->
gb
);
int
crop_bottom
=
get_ue_golomb
(
&
h
->
gb
);
int
width
=
16
*
sps
->
mb_width
;
int
height
=
16
*
sps
->
mb_height
*
(
2
-
sps
->
frame_mbs_only_flag
);
if
(
h
->
avctx
->
flags2
&
CODEC_FLAG2_IGNORE_CROP
)
{
av_log
(
h
->
avctx
,
AV_LOG_DEBUG
,
"discarding sps cropping, original "
...
...
@@ -487,6 +489,17 @@ int ff_h264_decode_seq_parameter_set(H264Context *h){
crop_left
);
}
if
(
crop_left
>
(
unsigned
)
INT_MAX
/
4
/
step_x
||
crop_right
>
(
unsigned
)
INT_MAX
/
4
/
step_x
||
crop_top
>
(
unsigned
)
INT_MAX
/
4
/
step_y
||
crop_bottom
>
(
unsigned
)
INT_MAX
/
4
/
step_y
||
(
crop_left
+
crop_right
)
*
step_x
>=
width
||
(
crop_top
+
crop_bottom
)
*
step_y
>=
height
)
{
av_log
(
h
->
avctx
,
AV_LOG_ERROR
,
"crop values invalid %d %d %d %d / %d %d
\n
"
,
crop_left
,
crop_right
,
crop_top
,
crop_bottom
,
width
,
height
);
goto
fail
;
}
sps
->
crop_left
=
crop_left
*
step_x
;
sps
->
crop_right
=
crop_right
*
step_x
;
sps
->
crop_top
=
crop_top
*
step_y
;
...
...
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