diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gsth265parser.c b/subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gsth265parser.c index d351a397e1..74fc25c0c0 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gsth265parser.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gsth265parser.c @@ -3726,11 +3726,15 @@ gst_h265_profile_tier_level_get_profiles (const GstH265ProfileTierLevel * ptl, GstH265Profile gst_h265_profile_tier_level_get_profile (const GstH265ProfileTierLevel * ptl) { - guint len; + guint len = 0; GstH265Profile profiles[GST_H265_PROFILE_MAX] = { GST_H265_PROFILE_INVALID, }; gst_h265_profile_tier_level_get_profiles (ptl, profiles, &len); - return profiles[0]; + + if (len > 0) + return profiles[0]; + + return GST_H265_PROFILE_INVALID; } /**