From 5018103fa32cdf5725e8e1309b9ddf89958910b1 Mon Sep 17 00:00:00 2001 From: rcombs Date: Thu, 23 Dec 2021 15:12:44 -0600 Subject: lavfi/drawutils: reject shift-packed formats Disables x2bgr10/x2rgb10 (which did not behave correctly before). --- libavfilter/drawutils.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libavfilter/drawutils.c') diff --git a/libavfilter/drawutils.c b/libavfilter/drawutils.c index 6b46f5803d..0965afb03e 100644 --- a/libavfilter/drawutils.c +++ b/libavfilter/drawutils.c @@ -105,6 +105,9 @@ int ff_draw_init(FFDrawContext *draw, enum AVPixelFormat format, unsigned flags) return AVERROR(ENOSYS); if (c->plane >= MAX_PLANES) return AVERROR(ENOSYS); + /* data must either be in the high or low bits, never middle */ + if (c->shift && ((c->shift + c->depth) & 0x7)) + return AVERROR(ENOSYS); /* strange interleaving */ if (pixelstep[c->plane] != 0 && pixelstep[c->plane] != c->step) -- cgit v1.2.3