mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2025-01-23 15:38:19 +00:00
video: Check that the passed in video info is valid when creating a VideoFrame
This commit is contained in:
parent
de0f228075
commit
997dad0f11
1 changed files with 16 additions and 0 deletions
|
@ -225,6 +225,8 @@ impl VideoFrame<Readable> {
|
|||
) -> Result<VideoFrame<Readable>, gst::Buffer> {
|
||||
skip_assert_initialized!();
|
||||
|
||||
assert!(info.is_valid());
|
||||
|
||||
unsafe {
|
||||
let mut frame = mem::MaybeUninit::zeroed();
|
||||
let res: bool = from_glib(gst_video_sys::gst_video_frame_map(
|
||||
|
@ -256,6 +258,8 @@ impl VideoFrame<Readable> {
|
|||
) -> Result<VideoFrame<Readable>, gst::Buffer> {
|
||||
skip_assert_initialized!();
|
||||
|
||||
assert!(info.is_valid());
|
||||
|
||||
unsafe {
|
||||
let mut frame = mem::MaybeUninit::zeroed();
|
||||
let res: bool = from_glib(gst_video_sys::gst_video_frame_map_id(
|
||||
|
@ -289,6 +293,8 @@ impl VideoFrame<Writable> {
|
|||
) -> Result<VideoFrame<Writable>, gst::Buffer> {
|
||||
skip_assert_initialized!();
|
||||
|
||||
assert!(info.is_valid());
|
||||
|
||||
unsafe {
|
||||
let mut frame = mem::MaybeUninit::zeroed();
|
||||
let res: bool = from_glib(gst_video_sys::gst_video_frame_map(
|
||||
|
@ -322,6 +328,8 @@ impl VideoFrame<Writable> {
|
|||
) -> Result<VideoFrame<Writable>, gst::Buffer> {
|
||||
skip_assert_initialized!();
|
||||
|
||||
assert!(info.is_valid());
|
||||
|
||||
unsafe {
|
||||
let mut frame = mem::MaybeUninit::zeroed();
|
||||
let res: bool = from_glib(gst_video_sys::gst_video_frame_map_id(
|
||||
|
@ -566,6 +574,8 @@ impl<'a> VideoFrameRef<&'a gst::BufferRef> {
|
|||
) -> Result<VideoFrameRef<&'a gst::BufferRef>, glib::BoolError> {
|
||||
skip_assert_initialized!();
|
||||
|
||||
assert!(info.is_valid());
|
||||
|
||||
unsafe {
|
||||
let mut frame = mem::MaybeUninit::zeroed();
|
||||
let res: bool = from_glib(gst_video_sys::gst_video_frame_map(
|
||||
|
@ -597,6 +607,8 @@ impl<'a> VideoFrameRef<&'a gst::BufferRef> {
|
|||
) -> Result<VideoFrameRef<&'a gst::BufferRef>, glib::BoolError> {
|
||||
skip_assert_initialized!();
|
||||
|
||||
assert!(info.is_valid());
|
||||
|
||||
unsafe {
|
||||
let mut frame = mem::MaybeUninit::zeroed();
|
||||
let res: bool = from_glib(gst_video_sys::gst_video_frame_map_id(
|
||||
|
@ -648,6 +660,8 @@ impl<'a> VideoFrameRef<&'a mut gst::BufferRef> {
|
|||
) -> Result<VideoFrameRef<&'a mut gst::BufferRef>, glib::BoolError> {
|
||||
skip_assert_initialized!();
|
||||
|
||||
assert!(info.is_valid());
|
||||
|
||||
unsafe {
|
||||
let mut frame = mem::MaybeUninit::zeroed();
|
||||
let res: bool = from_glib(gst_video_sys::gst_video_frame_map(
|
||||
|
@ -681,6 +695,8 @@ impl<'a> VideoFrameRef<&'a mut gst::BufferRef> {
|
|||
) -> Result<VideoFrameRef<&'a mut gst::BufferRef>, glib::BoolError> {
|
||||
skip_assert_initialized!();
|
||||
|
||||
assert!(info.is_valid());
|
||||
|
||||
unsafe {
|
||||
let mut frame = mem::MaybeUninit::zeroed();
|
||||
let res: bool = from_glib(gst_video_sys::gst_video_frame_map_id(
|
||||
|
|
Loading…
Reference in a new issue