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
0749082e
Commit
0749082e
authored
Oct 13, 2019
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_bm3d: fix heap-buffer overflows
Fixes #8262
parent
ccf4ab8c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
vf_bm3d.c
libavfilter/vf_bm3d.c
+4
-4
No files found.
libavfilter/vf_bm3d.c
View file @
0749082e
...
...
@@ -706,8 +706,8 @@ static int filter_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs)
const
int
plane
=
td
->
plane
;
const
int
width
=
s
->
planewidth
[
plane
];
const
int
height
=
s
->
planeheight
[
plane
];
const
int
block_pos_bottom
=
height
-
s
->
block_size
;
const
int
block_pos_right
=
width
-
s
->
block_size
;
const
int
block_pos_bottom
=
FFMAX
(
0
,
height
-
s
->
block_size
)
;
const
int
block_pos_right
=
FFMAX
(
0
,
width
-
s
->
block_size
)
;
const
int
slice_start
=
(((
height
+
block_step
-
1
)
/
block_step
)
*
jobnr
/
nb_jobs
)
*
block_step
;
const
int
slice_end
=
(
jobnr
==
nb_jobs
-
1
)
?
block_pos_bottom
+
block_step
:
(((
height
+
block_step
-
1
)
/
block_step
)
*
(
jobnr
+
1
)
/
nb_jobs
)
*
block_step
;
...
...
@@ -796,8 +796,8 @@ static int config_input(AVFilterLink *inlink)
for
(
i
=
0
;
i
<
s
->
nb_threads
;
i
++
)
{
SliceContext
*
sc
=
&
s
->
slices
[
i
];
sc
->
num
=
av_calloc
(
s
->
planewidth
[
0
]
*
s
->
planeheight
[
0
]
,
sizeof
(
FFTSample
));
sc
->
den
=
av_calloc
(
s
->
planewidth
[
0
]
*
s
->
planeheight
[
0
]
,
sizeof
(
FFTSample
));
sc
->
num
=
av_calloc
(
FFALIGN
(
s
->
planewidth
[
0
],
s
->
block_size
)
*
FFALIGN
(
s
->
planeheight
[
0
],
s
->
block_size
)
,
sizeof
(
FFTSample
));
sc
->
den
=
av_calloc
(
FFALIGN
(
s
->
planewidth
[
0
],
s
->
block_size
)
*
FFALIGN
(
s
->
planeheight
[
0
],
s
->
block_size
)
,
sizeof
(
FFTSample
));
if
(
!
sc
->
num
||
!
sc
->
den
)
return
AVERROR
(
ENOMEM
);
...
...
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