lavfi/drawutils: ensure we don't support formats with non-pixel-sized offsets

This commit is contained in:
rcombs 2021-12-23 20:56:50 -06:00
parent f320722eb5
commit f67bd3a825
1 changed files with 2 additions and 0 deletions

View File

@ -114,6 +114,8 @@ int ff_draw_init(FFDrawContext *draw, enum AVPixelFormat format, unsigned flags)
depthb = db; depthb = db;
if (db * (c->offset + 1) > 16) if (db * (c->offset + 1) > 16)
return AVERROR(ENOSYS); return AVERROR(ENOSYS);
if (c->offset % db)
return AVERROR(ENOSYS);
/* strange interleaving */ /* strange interleaving */
if (pixelstep[c->plane] != 0 && if (pixelstep[c->plane] != 0 &&
pixelstep[c->plane] != c->step) pixelstep[c->plane] != c->step)