summaryrefslogtreecommitdiff
path: root/libavfilter/vf_vidstabdetect.c
diff options
context:
space:
mode:
authorGyan Doshi <gyandoshi@gmail.com>2017-12-23 16:14:25 +0530
committerMichael Niedermayer <michael@niedermayer.cc>2018-01-17 20:02:14 +0100
commite1e89c0695b430ca1f0f869ac8a2b6b46be9e2fa (patch)
tree48f26a5b645e2d960ae1317f0a572981a3fa4207 /libavfilter/vf_vidstabdetect.c
parent383804edd812410219a097e2bf3efac8a8b4562a (diff)
downloadffmpeg-e1e89c0695b430ca1f0f869ac8a2b6b46be9e2fa.tar.gz
avfilter/vidstab: check bytesPerPixel only for packed formats.
libvidstab introduced this variable only for packed formats but in vf_vidstab*.c, it's checked for all inputs. So the filter errors out for YUV422/444P streams. Fixes #6736. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavfilter/vf_vidstabdetect.c')
-rw-r--r--libavfilter/vf_vidstabdetect.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavfilter/vf_vidstabdetect.c b/libavfilter/vf_vidstabdetect.c
index 63a178a0c2..fd7ff3be24 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);
}