Signed integer overflow is undefined behavior. Detected with clang and -fsanitize=signed-integer-overflow
Unified · Split
| @@ -971,7 +971,7 @@ FF_ENABLE_DEPRECATION_WARNINGS · 970 unmodified lines | ||
| 971 | 971 | } |
| 972 | 972 | |
| 973 | 973 | if (!avctx->rc_initial_buffer_occupancy) |
| 974 | − avctx->rc_initial_buffer_occupancy = avctx->rc_buffer_size * 3 / 4; | |
| 974 | + avctx->rc_initial_buffer_occupancy = avctx->rc_buffer_size * 3LL / 4; | |
| 975 | 975 | |
| 976 | 976 | if (avctx->ticks_per_frame && avctx->time_base.num && |
| 977 | 977 | avctx->ticks_per_frame > INT_MAX / avctx->time_base.num) { |