Commit 9519c8db authored by Limin Wang's avatar Limin Wang Committed by Michael Niedermayer

avfilter/vf_showinfo: fix the integer handling issues

Fixes CID 1457606 and 1457607
Signed-off-by: 's avatarLimin Wang <lance.lmwang@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 8a62d88b
......@@ -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];
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment