lavfi/drawutils: reject shift-packed formats

Disables x2bgr10/x2rgb10 (which did not behave correctly before).
This commit is contained in:
rcombs
2021-12-23 15:12:44 -06:00
parent 2641f7338d
commit b059ded2a9
2 changed files with 3 additions and 2 deletions

View File

@@ -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)