aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/vf_maskedclamp.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2017-04-23 18:01:00 +0200
committerPaul B Mahol <onemda@gmail.com>2017-04-23 18:21:50 +0200
commit9d1f9ba582aa8b62d08922a126fe36784d434003 (patch)
treebf4128c8e89f60062733ea7876806e7cec848080 /libavfilter/vf_maskedclamp.c
parent16c88465a1c1c2cb003590d667c4341c8da9372a (diff)
downloadffmpeg-9d1f9ba582aa8b62d08922a126fe36784d434003.tar.gz
avfilter/vf_maskedclamp: fix bug when copying >8bit plane(s)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavfilter/vf_maskedclamp.c')
-rw-r--r--libavfilter/vf_maskedclamp.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libavfilter/vf_maskedclamp.c b/libavfilter/vf_maskedclamp.c
index 3238e5146e..25c1a73be0 100644
--- a/libavfilter/vf_maskedclamp.c
+++ b/libavfilter/vf_maskedclamp.c
@@ -37,6 +37,7 @@ typedef struct MaskedClampContext {
int undershoot;
int overshoot;
+ int linesize[4];
int width[4], height[4];
int nb_planes;
int depth;
@@ -112,7 +113,7 @@ static int process_frame(FFFrameSync *fs)
for (p = 0; p < s->nb_planes; p++) {
if (!((1 << p) & s->planes)) {
av_image_copy_plane(out->data[p], out->linesize[p], base->data[p], base->linesize[p],
- s->width[p], s->height[p]);
+ s->linesize[p], s->height[p]);
continue;
}
@@ -195,10 +196,13 @@ static int config_input(AVFilterLink *inlink)
AVFilterContext *ctx = inlink->dst;
MaskedClampContext *s = ctx->priv;
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
- int vsub, hsub;
+ int vsub, hsub, ret;
s->nb_planes = av_pix_fmt_count_planes(inlink->format);
+ if ((ret = av_image_fill_linesizes(s->linesize, inlink->format, inlink->w)) < 0)
+ return ret;
+
hsub = desc->log2_chroma_w;
vsub = desc->log2_chroma_h;
s->height[1] = s->height[2] = AV_CEIL_RSHIFT(inlink->h, vsub);