[FFmpeg-cvslog] lavfi/drawutils: reject shift-packed formats

rcombs git at videolan.org
Wed Jan 5 03:41:27 EET 2022


ffmpeg | branch: master | rcombs <rcombs at rcombs.me> | Thu Dec 23 15:12:44 2021 -0600| [5018103fa32cdf5725e8e1309b9ddf89958910b1] | committer: rcombs

lavfi/drawutils: reject shift-packed formats

Disables x2bgr10/x2rgb10 (which did not behave correctly before).

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5018103fa32cdf5725e8e1309b9ddf89958910b1
---

 libavfilter/drawutils.c           | 3 +++
 tests/ref/fate/filter-pixfmts-pad | 2 --
 2 files changed, 3 insertions(+), 2 deletions(-)

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)
diff --git a/tests/ref/fate/filter-pixfmts-pad b/tests/ref/fate/filter-pixfmts-pad
index 1362d198b4..74981cd6c1 100644
--- a/tests/ref/fate/filter-pixfmts-pad
+++ b/tests/ref/fate/filter-pixfmts-pad
@@ -32,8 +32,6 @@ p416le              6db094f8d7d27d7299bf9496ad66e2e0
 rgb0                78d500c8361ab6423a4826a00268c908
 rgb24               17f9e2e0c609009acaf2175c42d4a2a5
 rgba                b157c90191463d34fb3ce77b36c96386
-x2bgr10le           d4aff89f5e15ccbb1812f319874ed444
-x2rgb10le           a0c5925bd56b6f85f918c4e9fb93e90e
 xyz12le             85abf80b77a9236a76ba0b00fcbdea2d
 ya16le              940fafa240b9916de5f73cb20a552f24
 ya8                 5fc0f471207ddf7aa01b07027d56b672



More information about the ffmpeg-cvslog mailing list