diff options
author | rcombs <rcombs@rcombs.me> | 2021-12-23 19:48:24 -0600 |
---|---|---|
committer | rcombs <rcombs@rcombs.me> | 2022-01-04 20:01:10 -0600 |
commit | 55ff7356bf805f6d038d1b2555c44c114ae7a58a (patch) | |
tree | d41f26185d5ee3ebe8e396ad702d505e462a2f0e | |
parent | c327743ee081b41bf19e4fbf2399a6b22f8ec281 (diff) | |
download | ffmpeg-55ff7356bf805f6d038d1b2555c44c114ae7a58a.tar.gz |
lavfi/drawutils: ensure we can't overflow a component
-rw-r--r-- | libavfilter/drawutils.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavfilter/drawutils.c b/libavfilter/drawutils.c index 99c124822d..bcdb669bd3 100644 --- a/libavfilter/drawutils.c +++ b/libavfilter/drawutils.c @@ -112,6 +112,8 @@ int ff_draw_init(FFDrawContext *draw, enum AVPixelFormat format, unsigned flags) if (depthb && (depthb != db)) return AVERROR(ENOSYS); depthb = db; + if (db * (c->offset + 1) > 16) + return AVERROR(ENOSYS); /* strange interleaving */ if (pixelstep[c->plane] != 0 && pixelstep[c->plane] != c->step) |