From dd7b672830cdf030422258bf382af7402fe309ac Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Thu, 29 Oct 2020 13:43:16 -0400 Subject: [PATCH] amc: Fix crash when encoding AVC gstamcvideoenc.c calls gst_amc_avc_profile_to_string() with alternatives set to NULL which causes a crash. Part-of: --- sys/androidmedia/gstamc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/androidmedia/gstamc.c b/sys/androidmedia/gstamc.c index 8276046..527446a 100644 --- a/sys/androidmedia/gstamc.c +++ b/sys/androidmedia/gstamc.c @@ -1197,7 +1197,8 @@ gst_amc_avc_profile_to_string (gint profile, const gchar ** alternative) for (i = 0; i < G_N_ELEMENTS (avc_profile_mapping_table); i++) { if (avc_profile_mapping_table[i].id == profile) { - *alternative = avc_profile_mapping_table[i].alt_str; + if (alternative != NULL) + *alternative = avc_profile_mapping_table[i].alt_str; return avc_profile_mapping_table[i].str; } } -- 2.7.4