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
1f24b33d
Commit
1f24b33d
authored
Oct 10, 2017
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_tile: remove limit of max tile size
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
6a50a8f3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
vf_tile.c
libavfilter/vf_tile.c
+12
-3
No files found.
libavfilter/vf_tile.c
View file @
1f24b33d
...
...
@@ -23,6 +23,7 @@
* tile video filter
*/
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
...
...
@@ -44,8 +45,6 @@ typedef struct TileContext {
uint8_t
rgba_color
[
4
];
}
TileContext
;
#define REASONABLE_SIZE 1024
#define OFFSET(x) offsetof(TileContext, x)
#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
...
...
@@ -68,12 +67,21 @@ static av_cold int init(AVFilterContext *ctx)
{
TileContext
*
tile
=
ctx
->
priv
;
if
(
tile
->
w
>
REASONABLE_SIZE
||
tile
->
h
>
REASONABLE_SIZE
)
{
if
(
tile
->
w
>
UINT_MAX
/
tile
->
h
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Tile size %ux%u is insane.
\n
"
,
tile
->
w
,
tile
->
h
);
return
AVERROR
(
EINVAL
);
}
if
(
tile
->
padding
)
{
if
((
tile
->
w
-
1
>
(
UINT32_MAX
-
2
*
tile
->
margin
)
/
tile
->
padding
)
||
(
tile
->
h
-
1
>
(
UINT32_MAX
-
2
*
tile
->
margin
)
/
tile
->
padding
))
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Combination of Tile size %ux%u, padding %d and margin %d overflows.
\n
"
,
tile
->
w
,
tile
->
h
,
tile
->
padding
,
tile
->
margin
);
return
AVERROR
(
EINVAL
);
}
}
if
(
tile
->
nb_frames
==
0
)
{
tile
->
nb_frames
=
tile
->
w
*
tile
->
h
;
}
else
if
(
tile
->
nb_frames
>
tile
->
w
*
tile
->
h
)
{
...
...
@@ -142,6 +150,7 @@ static void draw_blank_frame(AVFilterContext *ctx, AVFrame *out_buf)
x0
,
y0
,
inlink
->
w
,
inlink
->
h
);
tile
->
current
++
;
}
static
int
end_last_frame
(
AVFilterContext
*
ctx
)
{
TileContext
*
tile
=
ctx
->
priv
;
...
...
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