File tree 1 file changed +4
-7
lines changed
1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -1304,14 +1304,11 @@ static bool audio_bit_rate_invalid(uint32_t bit_rate)
1304
1304
1305
1305
static bool video_bit_rate_invalid (uint32_t bit_rate )
1306
1306
{
1307
- /* https://www.webmproject.org/docs/webm-sdk/structvpx__codec__enc__cfg.html shows the following:
1308
- * unsigned int rc_target_bitrate
1309
- * the range of uint varies from platform to platform
1310
- * though, uint32_t should be large enough to store bitrates,
1311
- * we may want to prevent from passing overflowed bitrates to libvpx
1312
- * more in detail, it's the case where bit_rate is larger than uint, but smaller than uint32_t
1307
+ /* Cap the target rate to 1000 Mbps to avoid some integer overflows in
1308
+ * target bandwidth calculations.
1309
+ * https://github.com/webmproject/libvpx/blob/027bbee30a0103b99d86327b48d29567fed11688/vp8/vp8_cx_iface.c#L350-L352
1313
1310
*/
1314
- return bit_rate > UINT32_MAX ;
1311
+ return bit_rate > 1000000 ;
1315
1312
}
1316
1313
1317
1314
static bool invoke_call_state_callback (ToxAV * av , uint32_t friend_number , uint32_t state )
You can’t perform that action at this time.
0 commit comments