From 9da12686561805a9b684ffd56aa0700302465ad2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 18 Jun 2024 16:27:39 +0300 Subject: [PATCH] video-info: Don't crash in gst_video_info_is_equal() if one videoinfo is zero-initialized Instead handle it like gst_audio_info_is_equal() and consider both different. And also add a shortcut for the pointers to both infos being equal. Part-of: --- subprojects/gst-plugins-base/gst-libs/gst/video/video-info.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/subprojects/gst-plugins-base/gst-libs/gst/video/video-info.c b/subprojects/gst-plugins-base/gst-libs/gst/video/video-info.c index 64ee0ff183..660d0c4b42 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/video/video-info.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/video/video-info.c @@ -605,6 +605,10 @@ gst_video_info_is_equal (const GstVideoInfo * info, const GstVideoInfo * other) { gint i; + if (info == other) + return TRUE; + if (info->finfo == NULL || other->finfo == NULL) + return FALSE; if (GST_VIDEO_INFO_FORMAT (info) != GST_VIDEO_INFO_FORMAT (other)) return FALSE; if (GST_VIDEO_INFO_INTERLACE_MODE (info) !=