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
558265d4
Commit
558265d4
authored
Sep 09, 2019
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_v360: add padding to u/v/ker
Fixes use of uninitialized variables.
parent
29bde4b3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
9 deletions
+15
-9
v360.h
libavfilter/v360.h
+1
-0
vf_v360.c
libavfilter/vf_v360.c
+14
-9
No files found.
libavfilter/v360.h
View file @
558265d4
...
...
@@ -110,6 +110,7 @@ typedef struct V360Context {
int
planewidth
[
4
],
planeheight
[
4
];
int
inplanewidth
[
4
],
inplaneheight
[
4
];
int
uv_linesize
[
4
];
int
nb_planes
;
int
nb_allocated
;
...
...
libavfilter/vf_v360.c
View file @
558265d4
...
...
@@ -222,6 +222,7 @@ static int remap##ws##_##bits##bit_slice(AVFilterContext *ctx, void *arg, int jo
for (int plane = 0; plane < s->nb_planes; plane++) { \
const int in_linesize = in->linesize[plane]; \
const int out_linesize = out->linesize[plane]; \
const int uv_linesize = s->uv_linesize[plane]; \
const uint8_t *src = in->data[plane]; \
uint8_t *dst = out->data[plane]; \
const int width = s->planewidth[plane]; \
...
...
@@ -232,9 +233,9 @@ static int remap##ws##_##bits##bit_slice(AVFilterContext *ctx, void *arg, int jo
\
for (int y = slice_start; y < slice_end; y++) { \
const unsigned map = s->map[plane]; \
const uint16_t *u = s->u[map] + y *
width * ws * ws;
\
const uint16_t *v = s->v[map] + y *
width * ws * ws;
\
const int16_t *ker = s->ker[map] + y *
width * ws * ws;
\
const uint16_t *u = s->u[map] + y *
uv_linesize * ws * ws;
\
const uint16_t *v = s->v[map] + y *
uv_linesize * ws * ws;
\
const int16_t *ker = s->ker[map] + y *
uv_linesize * ws * ws;
\
\
s->remap_line(dst + y * out_linesize, width, src, in_linesize, u, v, ker); \
} \
...
...
@@ -2035,12 +2036,12 @@ static inline void mirror(const float *modifier, float *vec)
static
int
allocate_plane
(
V360Context
*
s
,
int
sizeof_uv
,
int
sizeof_ker
,
int
p
)
{
s
->
u
[
p
]
=
av_calloc
(
s
->
planewidth
[
p
]
*
s
->
planeheight
[
p
],
sizeof_uv
);
s
->
v
[
p
]
=
av_calloc
(
s
->
planewidth
[
p
]
*
s
->
planeheight
[
p
],
sizeof_uv
);
s
->
u
[
p
]
=
av_calloc
(
s
->
uv_linesize
[
p
]
*
s
->
planeheight
[
p
],
sizeof_uv
);
s
->
v
[
p
]
=
av_calloc
(
s
->
uv_linesize
[
p
]
*
s
->
planeheight
[
p
],
sizeof_uv
);
if
(
!
s
->
u
[
p
]
||
!
s
->
v
[
p
])
return
AVERROR
(
ENOMEM
);
if
(
sizeof_ker
)
{
s
->
ker
[
p
]
=
av_calloc
(
s
->
planewidth
[
p
]
*
s
->
planeheight
[
p
],
sizeof_ker
);
s
->
ker
[
p
]
=
av_calloc
(
s
->
uv_linesize
[
p
]
*
s
->
planeheight
[
p
],
sizeof_ker
);
if
(
!
s
->
ker
[
p
])
return
AVERROR
(
ENOMEM
);
}
...
...
@@ -2266,6 +2267,9 @@ static int config_output(AVFilterLink *outlink)
s
->
planewidth
[
1
]
=
s
->
planewidth
[
2
]
=
FF_CEIL_RSHIFT
(
w
,
desc
->
log2_chroma_w
);
s
->
planewidth
[
0
]
=
s
->
planewidth
[
3
]
=
w
;
for
(
int
i
=
0
;
i
<
4
;
i
++
)
s
->
uv_linesize
[
i
]
=
FFALIGN
(
s
->
planewidth
[
i
],
8
);
outlink
->
h
=
h
;
outlink
->
w
=
w
;
...
...
@@ -2303,6 +2307,7 @@ static int config_output(AVFilterLink *outlink)
// Calculate remap data
for
(
p
=
0
;
p
<
s
->
nb_allocated
;
p
++
)
{
const
int
width
=
s
->
planewidth
[
p
];
const
int
uv_linesize
=
s
->
uv_linesize
[
p
];
const
int
height
=
s
->
planeheight
[
p
];
const
int
in_width
=
s
->
inplanewidth
[
p
];
const
int
in_height
=
s
->
inplaneheight
[
p
];
...
...
@@ -2313,9 +2318,9 @@ static int config_output(AVFilterLink *outlink)
for
(
i
=
0
;
i
<
width
;
i
++
)
{
for
(
j
=
0
;
j
<
height
;
j
++
)
{
uint16_t
*
u
=
s
->
u
[
p
]
+
(
j
*
width
+
i
)
*
elements
;
uint16_t
*
v
=
s
->
v
[
p
]
+
(
j
*
width
+
i
)
*
elements
;
int16_t
*
ker
=
s
->
ker
[
p
]
+
(
j
*
width
+
i
)
*
elements
;
uint16_t
*
u
=
s
->
u
[
p
]
+
(
j
*
uv_linesize
+
i
)
*
elements
;
uint16_t
*
v
=
s
->
v
[
p
]
+
(
j
*
uv_linesize
+
i
)
*
elements
;
int16_t
*
ker
=
s
->
ker
[
p
]
+
(
j
*
uv_linesize
+
i
)
*
elements
;
if
(
s
->
out_transpose
)
out_transform
(
s
,
j
,
i
,
height
,
width
,
vec
);
...
...
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