summaryrefslogtreecommitdiff
path: root/libavfilter/vf_signature.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2022-05-18 02:10:52 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2022-07-12 21:55:22 +0200
commitdd6040675ec18d19429f882caea6bb306ed6677a (patch)
treec99aa34b5cd15fa566cf930542a8da25a65add2c /libavfilter/vf_signature.c
parent73c0fd27c5c53c42e5060fb3a0c1fc5708b6f670 (diff)
downloadffmpeg-dd6040675ec18d19429f882caea6bb306ed6677a.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>
Diffstat (limited to 'libavfilter/vf_signature.c')
-rw-r--r--libavfilter/vf_signature.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavfilter/vf_signature.c b/libavfilter/vf_signature.c
index 5cff149756..7d434328b7 100644
--- a/libavfilter/vf_signature.c
+++ b/libavfilter/vf_signature.c
@@ -219,7 +219,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;
@@ -245,7 +245,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];