Can using Rust prevent recent libvpx and libwebp buffer overflow?

50 points Icy-Bauhaus

webp https://www.bleepingcomputer.com/news/security/google-assigns-new-maximum-rated-cve-to-libwebp-bug-exploited-in-attacks/

vpx https://www.bleepingcomputer.com/news/security/google-fixes-fifth-actively-exploited-chrome-zero-day-of-2023/

Presumbly writing these libraries in Rust should help, though it is possible that these libraries need to be very efficient or have special data structures that will force them to use unsafe, undermining safety. How much can Rust help?