Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
dc0e088d
Commit
dc0e088d
authored
Apr 27, 2009
by
Dylan Yudaken
Committed by
Jean-Baptiste Kempf
Apr 28, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add bounds checking to crop
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
1ed06e12
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
src/video_output/vout_intf.c
src/video_output/vout_intf.c
+21
-0
No files found.
src/video_output/vout_intf.c
View file @
dc0e088d
...
...
@@ -1032,6 +1032,13 @@ static int CropCallback( vlc_object_t *p_this, char const *psz_cmd,
i_crop_top
=
strtol
(
psz_end
,
&
psz_end
,
10
);
if
(
*
psz_end
!=
'\0'
)
goto
crop_end
;
if
(
i_crop_top
+
i_crop_height
>=
p_vout
->
fmt_render
.
i_visible_height
||
i_crop_left
+
i_crop_width
>=
p_vout
->
fmt_render
.
i_visible_width
)
{
msg_Err
(
p_vout
,
"Unable to crop over picture boundaries"
);
return
VLC_EGENERIC
;
}
i_width
=
i_crop_width
;
p_vout
->
fmt_in
.
i_visible_width
=
i_width
;
...
...
@@ -1062,6 +1069,13 @@ static int CropCallback( vlc_object_t *p_this, char const *psz_cmd,
i_crop_bottom
=
strtol
(
psz_end
,
&
psz_end
,
10
);
if
(
*
psz_end
!=
'\0'
)
goto
crop_end
;
if
(
i_crop_top
+
i_crop_bottom
>=
p_vout
->
fmt_render
.
i_visible_height
||
i_crop_right
+
i_crop_left
>=
p_vout
->
fmt_render
.
i_visible_width
)
{
msg_Err
(
p_vout
,
"Unable to crop over picture boundaries"
);
return
VLC_EGENERIC
;
}
i_width
=
p_vout
->
fmt_render
.
i_visible_width
-
i_crop_left
-
i_crop_right
;
p_vout
->
fmt_in
.
i_visible_width
=
i_width
;
...
...
@@ -1087,6 +1101,13 @@ static int CropCallback( vlc_object_t *p_this, char const *psz_cmd,
i_crop_right
=
var_GetInteger
(
p_vout
,
"crop-right"
);
i_crop_bottom
=
var_GetInteger
(
p_vout
,
"crop-bottom"
);
if
(
i_crop_top
+
i_crop_bottom
>=
p_vout
->
fmt_render
.
i_visible_height
||
i_crop_right
+
i_crop_left
>=
p_vout
->
fmt_render
.
i_visible_width
)
{
msg_Err
(
p_vout
,
"Unable to crop over picture boundaries"
);
return
VLC_EGENERIC
;
}
i_width
=
p_vout
->
fmt_render
.
i_visible_width
-
i_crop_left
-
i_crop_right
;
p_vout
->
fmt_in
.
i_visible_width
=
i_width
;
...
...
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