diff --git a/src/util/frame/video.rs b/src/util/frame/video.rs index aa17772..91ceb7e 100644 --- a/src/util/frame/video.rs +++ b/src/util/frame/video.rs @@ -245,7 +245,12 @@ impl Video { 8 } - fn plane_height(&self, index: usize) -> u32 { + #[inline] + pub fn plane_height(&self, index: usize) -> u32 { + if index >= self.planes() { + panic!("out of bounds"); + } + // Logic taken from av_image_fill_pointers(). if index != 1 && index != 2 { return self.height();