{"id":"RUSTSEC-2025-0169","title":"`FormatContext` stream accessors can cause undefined behavior from safe code","summary":"`FormatContext` stream accessors can cause undefined behavior from safe code","severity":"none","vendor":"stainless_ffmpeg","product":"stainless_ffmpeg","ecosystem":"rust","affected":["stainless_ffmpeg >= 0.0.0-0, < 0.6.0"],"patched":["stainless_ffmpeg 0.6.0"],"published":"2025-04-24","updated":"2026-08-11","source":"OSV","sourceUrl":"https://osv.dev/vulnerability/RUSTSEC-2025-0169","references":[{"url":"https://crates.io/crates/stainless_ffmpeg"},{"url":"https://rustsec.org/advisories/RUSTSEC-2025-0169.html"},{"url":"https://github.com/nomalab/stainless-ffmpeg/issues/63"},{"url":"https://github.com/nomalab/stainless-ffmpeg/pull/64"},{"url":"https://github.com/nomalab/stainless-ffmpeg/commit/a649e8cb4e7c9859279d1dc85051df5e7a4932f7"}],"tags":["osv","rust"],"ingestedAt":"2026-08-11T19:17:10.248Z","slug":"RUSTSEC-2025-0169","body":"## Overview\n\nAffected versions of `stainless_ffmpeg` exposed several safe public methods on `FormatContext` that accepted a `stream_index` parameter and used it in unsafe pointer operations without checking whether the index was valid. These methods performed pointer arithmetic and dereferenced the resulting stream pointer. Safe callers could pass a negative or out-of-bounds `stream_index`, which could cause out-of-bounds pointer access and undefined behavior from safe Rust code.\n\nThe issue was fixed in version `0.6.0` by marking the affected stream accessor methods as `unsafe` and documenting that callers must ensure `stream_index` is a valid stream index.\n\n## Affected packages\n\n- `stainless_ffmpeg >= 0.0.0-0, < 0.6.0`\n\n## Remediation\n\nUpgrade to a patched release:\n\n- `stainless_ffmpeg 0.6.0`","depth":"sunlit","depthScore":3,"depthScoreParts":{"impact":2.8,"likelihood":0,"exploitation":0,"ransomware":0},"changes":[]}