projects
/
ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0eec40b
)
avfilter/vf_cover_rect: clip rectangle if it is partly outside the input
author
Michael Niedermayer
<michaelni@gmx.at>
Mon, 4 May 2015 20:33:17 +0000
(22:33 +0200)
committer
Michael Niedermayer
<michaelni@gmx.at>
Mon, 4 May 2015 20:33:17 +0000
(22:33 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavfilter/vf_cover_rect.c
patch
|
blob
|
history
diff --git
a/libavfilter/vf_cover_rect.c
b/libavfilter/vf_cover_rect.c
index
7e1a9f4
..
d12807a
100644
(file)
--- a/
libavfilter/vf_cover_rect.c
+++ b/
libavfilter/vf_cover_rect.c
@@
-163,6
+163,17
@@
static int filter_frame(AVFilterLink *inlink, AVFrame *in)
return ff_filter_frame(ctx->outputs[0], in);
}
+ if (x < 0) {
+ w += x;
+ x = 0;
+ }
+ if (y < 0) {
+ h += y;
+ y = 0;
+ }
+ w = FFMIN(w, in->width - x);
+ h = FFMIN(h, in->height - y);
+
if (w > in->width || h > in->height || w <= 0 || h <= 0)
return AVERROR(EINVAL);