transcoder: Fix potential use of uninitialized variables

gst_structure_get won't touch variables if the field is not present
leading to potential use of initialized vars

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2044>
This commit is contained in:
Thibault Saunier 2021-02-26 15:36:48 -03:00 committed by GStreamer Merge Bot
parent 8c2fd4fff7
commit d252ab2e06

View file

@ -99,7 +99,7 @@ gst_transcoder_signal_adapter_emit (GstTranscoderSignalAdapter * self,
break; break;
case GST_TRANSCODER_MESSAGE_ERROR:{ case GST_TRANSCODER_MESSAGE_ERROR:{
GError *error = NULL; GError *error = NULL;
GstStructure *details; GstStructure *details = NULL;
gst_structure_get (message_data, GST_TRANSCODER_MESSAGE_DATA_ERROR, gst_structure_get (message_data, GST_TRANSCODER_MESSAGE_DATA_ERROR,
G_TYPE_ERROR, &error, GST_TYPE_STRUCTURE, &details, NULL); G_TYPE_ERROR, &error, GST_TYPE_STRUCTURE, &details, NULL);
@ -110,7 +110,7 @@ gst_transcoder_signal_adapter_emit (GstTranscoderSignalAdapter * self,
break; break;
} }
case GST_TRANSCODER_MESSAGE_WARNING:{ case GST_TRANSCODER_MESSAGE_WARNING:{
GstStructure *details; GstStructure *details = NULL;
GError *error = NULL; GError *error = NULL;
gst_structure_get (message_data, GST_TRANSCODER_MESSAGE_DATA_WARNING, gst_structure_get (message_data, GST_TRANSCODER_MESSAGE_DATA_WARNING,