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
f67aff3a
Commit
f67aff3a
authored
Sep 04, 2015
by
Pedro Arthur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swscale: added proper error check for ff_init_filters
parent
f7361dbc
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
slice.c
libswscale/slice.c
+11
-6
No files found.
libswscale/slice.c
View file @
f67aff3a
...
@@ -268,7 +268,8 @@ int ff_init_filters(SwsContext * c)
...
@@ -268,7 +268,8 @@ int ff_init_filters(SwsContext * c)
dstIdx
=
1
;
dstIdx
=
1
;
if
(
need_lum_conv
)
{
if
(
need_lum_conv
)
{
ff_init_desc_fmt_convert
(
&
c
->
desc
[
index
],
&
c
->
slice
[
srcIdx
],
&
c
->
slice
[
dstIdx
],
pal
);
res
=
ff_init_desc_fmt_convert
(
&
c
->
desc
[
index
],
&
c
->
slice
[
srcIdx
],
&
c
->
slice
[
dstIdx
],
pal
);
if
(
res
<
0
)
goto
cleanup
;
c
->
desc
[
index
].
alpha
=
c
->
alpPixBuf
!=
0
;
c
->
desc
[
index
].
alpha
=
c
->
alpPixBuf
!=
0
;
++
index
;
++
index
;
srcIdx
=
dstIdx
;
srcIdx
=
dstIdx
;
...
@@ -276,7 +277,8 @@ int ff_init_filters(SwsContext * c)
...
@@ -276,7 +277,8 @@ int ff_init_filters(SwsContext * c)
dstIdx
=
FFMAX
(
num_ydesc
,
num_cdesc
);
dstIdx
=
FFMAX
(
num_ydesc
,
num_cdesc
);
ff_init_desc_hscale
(
&
c
->
desc
[
index
],
&
c
->
slice
[
index
],
&
c
->
slice
[
dstIdx
],
c
->
hLumFilter
,
c
->
hLumFilterPos
,
c
->
hLumFilterSize
,
c
->
lumXInc
);
res
=
ff_init_desc_hscale
(
&
c
->
desc
[
index
],
&
c
->
slice
[
srcIdx
],
&
c
->
slice
[
dstIdx
],
c
->
hLumFilter
,
c
->
hLumFilterPos
,
c
->
hLumFilterSize
,
c
->
lumXInc
);
if
(
res
<
0
)
goto
cleanup
;
c
->
desc
[
index
].
alpha
=
c
->
alpPixBuf
!=
0
;
c
->
desc
[
index
].
alpha
=
c
->
alpPixBuf
!=
0
;
...
@@ -285,23 +287,26 @@ int ff_init_filters(SwsContext * c)
...
@@ -285,23 +287,26 @@ int ff_init_filters(SwsContext * c)
srcIdx
=
0
;
srcIdx
=
0
;
dstIdx
=
1
;
dstIdx
=
1
;
if
(
need_chr_conv
)
{
if
(
need_chr_conv
)
{
ff_init_desc_cfmt_convert
(
&
c
->
desc
[
index
],
&
c
->
slice
[
srcIdx
],
&
c
->
slice
[
dstIdx
],
pal
);
res
=
ff_init_desc_cfmt_convert
(
&
c
->
desc
[
index
],
&
c
->
slice
[
srcIdx
],
&
c
->
slice
[
dstIdx
],
pal
);
if
(
res
<
0
)
goto
cleanup
;
++
index
;
++
index
;
srcIdx
=
dstIdx
;
srcIdx
=
dstIdx
;
}
}
dstIdx
=
FFMAX
(
num_ydesc
,
num_cdesc
);
dstIdx
=
FFMAX
(
num_ydesc
,
num_cdesc
);
if
(
c
->
needs_hcscale
)
if
(
c
->
needs_hcscale
)
ff_init_desc_chscale
(
&
c
->
desc
[
index
],
&
c
->
slice
[
srcIdx
],
&
c
->
slice
[
dstIdx
],
c
->
hChrFilter
,
c
->
hChrFilterPos
,
c
->
hChrFilterSize
,
c
->
chrXInc
);
res
=
ff_init_desc_chscale
(
&
c
->
desc
[
index
],
&
c
->
slice
[
srcIdx
],
&
c
->
slice
[
dstIdx
],
c
->
hChrFilter
,
c
->
hChrFilterPos
,
c
->
hChrFilterSize
,
c
->
chrXInc
);
else
else
ff_init_desc_no_chr
(
&
c
->
desc
[
index
],
&
c
->
slice
[
srcIdx
],
&
c
->
slice
[
dstIdx
]);
res
=
ff_init_desc_no_chr
(
&
c
->
desc
[
index
],
&
c
->
slice
[
srcIdx
],
&
c
->
slice
[
dstIdx
]);
if
(
res
<
0
)
goto
cleanup
;
}
}
++
index
;
++
index
;
{
{
srcIdx
=
c
->
numSlice
-
2
;
srcIdx
=
c
->
numSlice
-
2
;
dstIdx
=
c
->
numSlice
-
1
;
dstIdx
=
c
->
numSlice
-
1
;
ff_init_vscale
(
c
,
c
->
desc
+
index
,
c
->
slice
+
srcIdx
,
c
->
slice
+
dstIdx
);
res
=
ff_init_vscale
(
c
,
c
->
desc
+
index
,
c
->
slice
+
srcIdx
,
c
->
slice
+
dstIdx
);
if
(
res
<
0
)
goto
cleanup
;
}
}
return
0
;
return
0
;
...
...
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