X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavfilter%2Fvf_vidstabdetect.c;h=fd7ff3be24b0e908a3364f3483ee97f088a31eb1;hb=5409f065f2c48ad9c4baf787d08384176cbc62a4;hp=63a178a0c2b5c16e52a7ec6ade8ee3546360d506;hpb=dae6d27aa0b02e05790b7c4dc99f7f6b07223ea1;p=ffmpeg diff --git a/libavfilter/vf_vidstabdetect.c b/libavfilter/vf_vidstabdetect.c index 63a178a0c2b..fd7ff3be24b 100644 --- a/libavfilter/vf_vidstabdetect.c +++ b/libavfilter/vf_vidstabdetect.c @@ -107,10 +107,11 @@ static int config_input(AVFilterLink *inlink) VSMotionDetect* md = &(s->md); VSFrameInfo fi; const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format); + int is_planar = desc->flags & AV_PIX_FMT_FLAG_PLANAR; vsFrameInfoInit(&fi, inlink->w, inlink->h, ff_av2vs_pixfmt(ctx, inlink->format)); - if (fi.bytesPerPixel != av_get_bits_per_pixel(desc)/8) { + if (!is_planar && fi.bytesPerPixel != av_get_bits_per_pixel(desc)/8) { av_log(ctx, AV_LOG_ERROR, "pixel-format error: wrong bits/per/pixel, please report a BUG"); return AVERROR(EINVAL); }