diff --git a/gstreamer/src/caps.rs b/gstreamer/src/caps.rs index b301c1b3a..0612a3265 100644 --- a/gstreamer/src/caps.rs +++ b/gstreamer/src/caps.rs @@ -445,6 +445,8 @@ impl CapsRef { #[doc(alias = "gst_caps_remove_structure")] pub fn remove_structure(&mut self, idx: u32) { + assert!(idx < self.size()); + unsafe { ffi::gst_caps_remove_structure(self.as_mut_ptr(), idx) } }