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: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1732>
This commit is contained in:
Xavier Claessens 2020-10-29 13:43:16 -04:00 committed by GStreamer Merge Bot
parent bfb9071081
commit dd7b672830

View file

@ -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++) { for (i = 0; i < G_N_ELEMENTS (avc_profile_mapping_table); i++) {
if (avc_profile_mapping_table[i].id == profile) { 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; return avc_profile_mapping_table[i].str;
} }
} }