From e8b818b581b9ab7e9c8f7b1becd753dd4efbdf43 Mon Sep 17 00:00:00 2001 From: "Jorge E. Moreira" Date: Fri, 8 May 2020 15:14:48 -0700 Subject: Don't collect stats if they won't be used When the encoder is run continuously for a few minutes at 60 fps, the total_target_vs_actual field overflows. Since this field is a signed integer that's considered undefined behavior in C++, which causes an abort when used in an android binary (those run with ubsan enabled) Bug: b/154172422 Test: run cuttelfish with webrtc enabled for an hour Change-Id: I8f7d9d0884311a6338bdcdec76348b8cc3ce8c69 --- vp8/encoder/onyx_if.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'vp8') diff --git a/vp8/encoder/onyx_if.c b/vp8/encoder/onyx_if.c index 3f5b9816d..dccc6ebb1 100644 --- a/vp8/encoder/onyx_if.c +++ b/vp8/encoder/onyx_if.c @@ -4533,9 +4533,11 @@ static void encode_frame_to_data_rate(VP8_COMP *cpi, size_t *size, /* Actual bits spent */ cpi->total_actual_bits += cpi->projected_frame_size; +#if 0 && CONFIG_INTERNAL_STATS /* Debug stats */ cpi->total_target_vs_actual += (cpi->this_frame_target - cpi->projected_frame_size); +#endif cpi->buffer_level = cpi->bits_off_target; -- cgit v1.2.3