cdg: typefind: Division by zero fix

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2137>
This commit is contained in:
tomaszmi 2025-03-24 15:16:39 +01:00
parent 47ea36be9d
commit 5edcad3734

View file

@ -34,7 +34,7 @@ fn cdg_packets_ratio(typefind: &mut TypeFind, start: i64, len: i64) -> i64 {
None => break,
}
}
(count * 100) / total
if total == 0 { 0 } else { (count * 100) / total }
}
/* Some CDG files starts drawing right away and then pause for a while