summaryrefslogtreecommitdiff
path: root/libavfilter/drawutils.c
diff options
context:
space:
mode:
authorrcombs <rcombs@rcombs.me>2021-12-23 19:48:24 -0600
committerrcombs <rcombs@rcombs.me>2022-01-04 19:39:22 -0600
commitf320722eb5e3af84860063827636369115094ab5 (patch)
tree15b318794e12ab3d420d53882aa5bdba6763abb8 /libavfilter/drawutils.c
parentf00079b25c44d6b9f01bb3688bfd1cd49abefac8 (diff)
downloadffmpeg-f320722eb5e3af84860063827636369115094ab5.tar.gz
lavfi/drawutils: ensure we can't overflow a component
Diffstat (limited to 'libavfilter/drawutils.c')
-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)