summaryrefslogtreecommitdiff
path: root/libavfilter
diff options
context:
space:
mode:
authorrcombs <rcombs@rcombs.me>2021-12-23 19:48:24 -0600
committerrcombs <rcombs@rcombs.me>2022-01-04 20:01:10 -0600
commit55ff7356bf805f6d038d1b2555c44c114ae7a58a (patch)
treed41f26185d5ee3ebe8e396ad702d505e462a2f0e /libavfilter
parentc327743ee081b41bf19e4fbf2399a6b22f8ec281 (diff)
downloadffmpeg-55ff7356bf805f6d038d1b2555c44c114ae7a58a.tar.gz
lavfi/drawutils: ensure we can't overflow a component
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/drawutils.c2
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)