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
f48efb14
Commit
f48efb14
authored
Jul 22, 2017
by
Mark Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pixdesc: Explicitly handle invalid arguments to av_find_best_pix_fmt_of_2()
parent
d24a82d2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
pixdesc.c
libavutil/pixdesc.c
+6
-0
No files found.
libavutil/pixdesc.c
View file @
f48efb14
...
...
@@ -2633,6 +2633,11 @@ enum AVPixelFormat av_find_best_pix_fmt_of_2(enum AVPixelFormat dst_pix_fmt1, en
const
AVPixFmtDescriptor
*
desc2
=
av_pix_fmt_desc_get
(
dst_pix_fmt2
);
int
score1
,
score2
;
if
(
!
desc1
)
{
dst_pix_fmt
=
dst_pix_fmt2
;
}
else
if
(
!
desc2
)
{
dst_pix_fmt
=
dst_pix_fmt1
;
}
else
{
loss_mask
=
loss_ptr
?~*
loss_ptr
:~
0
;
/* use loss mask if provided */
if
(
!
has_alpha
)
loss_mask
&=
~
FF_LOSS_ALPHA
;
...
...
@@ -2649,6 +2654,7 @@ enum AVPixelFormat av_find_best_pix_fmt_of_2(enum AVPixelFormat dst_pix_fmt1, en
}
else
{
dst_pix_fmt
=
score1
<
score2
?
dst_pix_fmt2
:
dst_pix_fmt1
;
}
}
if
(
loss_ptr
)
*
loss_ptr
=
av_get_pix_fmt_loss
(
dst_pix_fmt
,
src_pix_fmt
,
has_alpha
);
...
...
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