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
f8f42f48
Commit
f8f42f48
authored
May 29, 2013
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi/noise: fix out of array access
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
83f97355
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
vf_noise.c
libavfilter/vf_noise.c
+5
-4
No files found.
libavfilter/vf_noise.c
View file @
f8f42f48
...
@@ -35,7 +35,7 @@
...
@@ -35,7 +35,7 @@
#include "internal.h"
#include "internal.h"
#include "video.h"
#include "video.h"
#define MAX_NOISE
4096
#define MAX_NOISE
5120
#define MAX_SHIFT 1024
#define MAX_SHIFT 1024
#define MAX_RES (MAX_NOISE-MAX_SHIFT)
#define MAX_RES (MAX_NOISE-MAX_SHIFT)
...
@@ -347,14 +347,15 @@ static void noise(uint8_t *dst, const uint8_t *src,
...
@@ -347,14 +347,15 @@ static void noise(uint8_t *dst, const uint8_t *src,
}
}
for
(
y
=
start
;
y
<
end
;
y
++
)
{
for
(
y
=
start
;
y
<
end
;
y
++
)
{
const
int
ix
=
y
&
(
MAX_RES
-
1
);
if
(
flags
&
NOISE_TEMPORAL
)
if
(
flags
&
NOISE_TEMPORAL
)
shift
=
av_lfg_get
(
lfg
)
&
(
MAX_SHIFT
-
1
);
shift
=
av_lfg_get
(
lfg
)
&
(
MAX_SHIFT
-
1
);
else
else
shift
=
n
->
rand_shift
[
y
];
shift
=
n
->
rand_shift
[
ix
];
if
(
flags
&
NOISE_AVERAGED
)
{
if
(
flags
&
NOISE_AVERAGED
)
{
n
->
line_noise_avg
(
dst
,
src
,
width
,
p
->
prev_shift
[
y
]);
n
->
line_noise_avg
(
dst
,
src
,
width
,
p
->
prev_shift
[
ix
]);
p
->
prev_shift
[
y
][
shift
&
3
]
=
noise
+
shift
;
p
->
prev_shift
[
ix
][
shift
&
3
]
=
noise
+
shift
;
}
else
{
}
else
{
n
->
line_noise
(
dst
,
src
,
noise
,
width
,
shift
);
n
->
line_noise
(
dst
,
src
,
noise
,
width
,
shift
);
}
}
...
...
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