diff mbox series

[FFmpeg-devel,v2,1/5] avfilter/drawutils: ban XYZ formats

Message ID 20231026142327.52694-1-ffmpeg@haasn.xyz
State New
Headers show
Series [FFmpeg-devel,v2,1/5] avfilter/drawutils: ban XYZ formats | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Niklas Haas Oct. 26, 2023, 2:23 p.m. UTC
From: Niklas Haas <git@haasn.dev>

These are not supported by the drawing functions at all, and were
incorrectly advertised as supported in the past.

Note: This check is added only to separate the logic change from the API
change in the following commit, and will be removed again after it
becomes redundant.
---
 libavfilter/drawutils.c           | 3 +++
 tests/ref/fate/filter-pixfmts-pad | 1 -
 2 files changed, 3 insertions(+), 1 deletion(-)

Comments

Niklas Haas Oct. 30, 2023, 2:23 p.m. UTC | #1
Will apply this after 24h if there is no further feedback.
diff mbox series

Patch

diff --git a/libavfilter/drawutils.c b/libavfilter/drawutils.c
index 1081938d86..c31ab6bd5a 100644
--- a/libavfilter/drawutils.c
+++ b/libavfilter/drawutils.c
@@ -22,6 +22,7 @@ 
 #include <string.h>
 
 #include "libavutil/avassert.h"
+#include "libavutil/avstring.h"
 #include "libavutil/avutil.h"
 #include "libavutil/csp.h"
 #include "libavutil/intreadwrite.h"
@@ -93,6 +94,8 @@  int ff_draw_init2(FFDrawContext *draw, enum AVPixelFormat format, enum AVColorSp
         return AVERROR(ENOSYS);
     if (desc->flags & ~(AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA))
         return AVERROR(ENOSYS);
+    if (av_strstart(desc->name, "xyz", NULL))
+        return AVERROR(ENOSYS);
     if (csp == AVCOL_SPC_UNSPECIFIED)
         csp = (desc->flags & AV_PIX_FMT_FLAG_RGB) ? AVCOL_SPC_RGB : AVCOL_SPC_SMPTE170M;
     if (!(desc->flags & AV_PIX_FMT_FLAG_RGB) && !(luma = av_csp_luma_coeffs_from_avcsp(csp)))
diff --git a/tests/ref/fate/filter-pixfmts-pad b/tests/ref/fate/filter-pixfmts-pad
index dd01059c59..b4d236d408 100644
--- a/tests/ref/fate/filter-pixfmts-pad
+++ b/tests/ref/fate/filter-pixfmts-pad
@@ -43,7 +43,6 @@  rgb48le             ed08db9b1aa50d69b8c3d73db93e390e
 rgba                b157c90191463d34fb3ce77b36c96386
 vuya                44368c0a758ee68e24ce976e3b1b8535
 vuyx                bc7c4f693a22cd1ac95e33d473086474
-xyz12le             23dadbbba70b2925ce75fb8ba8080ba3
 ya16le              8dbfcb586abf626da7d1aca887a581b9
 ya8                 495daaca2dcb4f7aeba7652768b41ced
 yuv410p             cb871dcc1e84a7ef1d21f9237b88cf6e