diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2022-05-18 02:10:52 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2022-10-09 22:15:40 +0200 |
commit | b3fdcaca7be89d9d133f0ff4e23eb8ed863dcff8 (patch) | |
tree | 97b62c97a5b59dd6306db25a4701739b5b944f71 | |
parent | 6c1a7a829d5c1dc57f0411c7116effc5e8e6b1f2 (diff) | |
download | ffmpeg-b3fdcaca7be89d9d133f0ff4e23eb8ed863dcff8.tar.gz |
avfilter/vf_signature: Fix integer overflow in filter_frame()
Fixes: CID1403233
The second of the 2 changes may be unneeded but will help coverity
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit dd6040675ec18d19429f882caea6bb306ed6677a)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavfilter/vf_signature.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavfilter/vf_signature.c b/libavfilter/vf_signature.c index d07b213f31..8bdd7f55a2 100644 --- a/libavfilter/vf_signature.c +++ b/libavfilter/vf_signature.c @@ -223,7 +223,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *picref) dw1 = inlink->w / 32; if (inlink->w % 32) dw2 = dw1 + 1; - denom = (sc->divide) ? dh1 * dh2 * dw1 * dw2 : 1; + denom = (sc->divide) ? dh1 * (int64_t)dh2 * dw1 * dw2 : 1; for (i = 0; i < 32; i++) { rowcount = 0; @@ -249,7 +249,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *picref) } } - denom = (sc->divide) ? 1 : dh1 * dh2 * dw1 * dw2; + denom = (sc->divide) ? 1 : dh1 * (int64_t)dh2 * dw1 * dw2; for (i = 0; i < ELEMENT_COUNT; i++) { const ElemCat* elemcat = elements[i]; |