Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
52b77526
Commit
52b77526
authored
Aug 27, 2008
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed segfault with invalid vout input aspect ratio.
parent
dc977392
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
13 deletions
+21
-13
src/video_output/video_output.c
src/video_output/video_output.c
+8
-2
src/video_output/vout_pictures.c
src/video_output/vout_pictures.c
+13
-11
No files found.
src/video_output/video_output.c
View file @
52b77526
...
...
@@ -227,6 +227,14 @@ vout_thread_t * __vout_Create( vlc_object_t *p_parent, video_format_t *p_fmt )
char
*
psz_parser
;
char
*
psz_name
;
if
(
i_width
<=
0
||
i_height
<=
0
||
i_aspect
<=
0
)
return
NULL
;
vlc_ureduce
(
&
p_fmt
->
i_sar_num
,
&
p_fmt
->
i_sar_den
,
p_fmt
->
i_sar_num
,
p_fmt
->
i_sar_den
,
50000
);
if
(
p_fmt
->
i_sar_num
<=
0
||
p_fmt
->
i_sar_den
<=
0
)
return
NULL
;
/* Allocate descriptor */
static
const
char
typename
[]
=
"video output"
;
p_vout
=
vlc_custom_create
(
p_parent
,
sizeof
(
*
p_vout
),
VLC_OBJECT_VOUT
,
...
...
@@ -251,8 +259,6 @@ vout_thread_t * __vout_Create( vlc_object_t *p_parent, video_format_t *p_fmt )
/* Initialize the rendering heap */
I_RENDERPICTURES
=
0
;
vlc_ureduce
(
&
p_fmt
->
i_sar_num
,
&
p_fmt
->
i_sar_den
,
p_fmt
->
i_sar_num
,
p_fmt
->
i_sar_den
,
50000
);
p_vout
->
fmt_render
=
*
p_fmt
;
/* FIXME palette */
p_vout
->
fmt_in
=
*
p_fmt
;
/* FIXME palette */
...
...
src/video_output/vout_pictures.c
View file @
52b77526
...
...
@@ -471,20 +471,22 @@ void vout_PlacePicture( vout_thread_t *p_vout,
*
pi_height
=
__MIN
(
i_height
,
p_vout
->
fmt_in
.
i_visible_height
);
}
if
(
p_vout
->
fmt_in
.
i_visible_width
*
(
int64_t
)
p_vout
->
fmt_in
.
i_sar_num
*
*
pi_height
/
p_vout
->
fmt_in
.
i_visible_height
/
p_vout
->
fmt_in
.
i_sar_den
>
*
pi_width
)
int64_t
i_scaled_width
=
p_vout
->
fmt_in
.
i_visible_width
*
(
int64_t
)
p_vout
->
fmt_in
.
i_sar_num
*
*
pi_height
/
p_vout
->
fmt_in
.
i_visible_height
/
p_vout
->
fmt_in
.
i_sar_den
;
int64_t
i_scaled_height
=
p_vout
->
fmt_in
.
i_visible_height
*
(
int64_t
)
p_vout
->
fmt_in
.
i_sar_den
*
*
pi_width
/
p_vout
->
fmt_in
.
i_visible_width
/
p_vout
->
fmt_in
.
i_sar_num
;
if
(
i_scaled_width
<=
0
||
i_scaled_height
<=
0
)
{
*
pi_height
=
p_vout
->
fmt_in
.
i_visible_height
*
(
int64_t
)
p_vout
->
fmt_in
.
i_sar_den
*
*
pi_width
/
p_vout
->
fmt_in
.
i_visible_width
/
p_vout
->
fmt_in
.
i_sar_num
;
msg_Warn
(
p_vout
,
"ignoring broken aspect ratio"
);
i_scaled_width
=
*
pi_width
;
i_scaled_height
=
*
pi_height
;
}
if
(
i_scaled_width
>
*
pi_width
)
*
pi_height
=
i_scaled_height
;
else
{
*
pi_width
=
p_vout
->
fmt_in
.
i_visible_width
*
(
int64_t
)
p_vout
->
fmt_in
.
i_sar_num
*
*
pi_height
/
p_vout
->
fmt_in
.
i_visible_height
/
p_vout
->
fmt_in
.
i_sar_den
;
}
*
pi_width
=
i_scaled_width
;
switch
(
p_vout
->
i_alignment
&
VOUT_ALIGN_HMASK
)
{
...
...
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