The code above this does a whitelist on desc->flags, which now includes the (disallowed) AV_PIX_FMT_FLAG_XYZ for XYZ formats. So there is no more need for a separate check, here.
Unified · Split
| @@ -22,7 +22,6 @@ · 21 unmodified lines | |||
| 22 | #include <string.h> | 22 | #include <string.h> |
| 23 | 23 | ||
| 24 | #include "libavutil/avassert.h" | 24 | #include "libavutil/avassert.h" |
| 25 | #include "libavutil/avstring.h" | ||
| 26 | #include "libavutil/avutil.h" | 25 | #include "libavutil/avutil.h" |
| 27 | #include "libavutil/csp.h" | 26 | #include "libavutil/csp.h" |
| 28 | #include "libavutil/intreadwrite.h" | 27 | #include "libavutil/intreadwrite.h" |
| @@ -94,8 +93,6 @@ int ff_draw_init2(FFDrawContext *draw, enum AVPixelFormat format, enum AVColorSp · 65 unmodified lines | |||
| 94 | return AVERROR(ENOSYS); | 93 | return AVERROR(ENOSYS); |
| 95 | if (desc->flags & ~(AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA)) | 94 | if (desc->flags & ~(AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA)) |
| 96 | return AVERROR(ENOSYS); | 95 | return AVERROR(ENOSYS); |
| 97 | if (av_strstart(desc->name, "xyz", NULL)) | ||
| 98 | return AVERROR(ENOSYS); | ||
| 99 | if (csp == AVCOL_SPC_UNSPECIFIED) | 96 | if (csp == AVCOL_SPC_UNSPECIFIED) |
| 100 | csp = (desc->flags & AV_PIX_FMT_FLAG_RGB) ? AVCOL_SPC_RGB : AVCOL_SPC_SMPTE170M; | 97 | csp = (desc->flags & AV_PIX_FMT_FLAG_RGB) ? AVCOL_SPC_RGB : AVCOL_SPC_SMPTE170M; |
| 101 | if (!(desc->flags & AV_PIX_FMT_FLAG_RGB) && !(luma = av_csp_luma_coeffs_from_avcsp(csp))) | 98 | if (!(desc->flags & AV_PIX_FMT_FLAG_RGB) && !(luma = av_csp_luma_coeffs_from_avcsp(csp))) |