aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/vf_showinfo.c
diff options
context:
space:
mode:
authorLimin Wang <lance.lmwang@gmail.com>2020-01-09 09:02:11 +0800
committerMichael Niedermayer <michael@niedermayer.cc>2020-01-10 17:52:14 +0100
commit9519c8dbb749c8c658b4ada6f6e03cea7521e611 (patch)
tree1610d366e2a7b2d69aa799608a49b4635f697675 /libavfilter/vf_showinfo.c
parent8a62d88b0ef99d00f680185c94a5526ff0fe381b (diff)
downloadffmpeg-9519c8dbb749c8c658b4ada6f6e03cea7521e611.tar.gz
avfilter/vf_showinfo: fix the integer handling issues
Fixes CID 1457606 and 1457607 Signed-off-by: Limin Wang <lance.lmwang@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavfilter/vf_showinfo.c')
-rw-r--r--libavfilter/vf_showinfo.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavfilter/vf_showinfo.c b/libavfilter/vf_showinfo.c
index 5fff123682..79b79db2d3 100644
--- a/libavfilter/vf_showinfo.c
+++ b/libavfilter/vf_showinfo.c
@@ -221,10 +221,10 @@ static void update_sample_stats_16(int be, const uint8_t *src, int len, int64_t
for (i = 0; i < len / 2; i++) {
if ((HAVE_BIGENDIAN && !be) || (!HAVE_BIGENDIAN && be)) {
*sum += av_bswap16(src1[i]);
- *sum2 += av_bswap16(src1[i]) * av_bswap16(src1[i]);
+ *sum2 += (uint32_t)av_bswap16(src1[i]) * (uint32_t)av_bswap16(src1[i]);
} else {
*sum += src1[i];
- *sum2 += src1[i] * src1[i];
+ *sum2 += (uint32_t)src1[i] * (uint32_t)src1[i];
}
}
}