mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-31 22:49:02 +00:00
audioparsers: Check for NULL return value of gst_pad_get_current_caps()
https://bugzilla.gnome.org/show_bug.cgi?id=759503
This commit is contained in:
parent
bf74d37c4e
commit
328346ad21
8 changed files with 86 additions and 12 deletions
|
@ -1370,10 +1370,19 @@ gst_aac_parse_pre_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame)
|
|||
GstTagList *taglist;
|
||||
GstCaps *caps;
|
||||
|
||||
taglist = gst_tag_list_new_empty ();
|
||||
|
||||
/* codec tag */
|
||||
caps = gst_pad_get_current_caps (GST_BASE_PARSE_SRC_PAD (parse));
|
||||
if (caps == NULL) {
|
||||
if (GST_PAD_IS_FLUSHING (GST_BASE_PARSE_SRC_PAD (parse))) {
|
||||
GST_INFO_OBJECT (parse, "Src pad is flushing");
|
||||
return GST_FLOW_FLUSHING;
|
||||
} else {
|
||||
GST_INFO_OBJECT (parse, "Src pad is not negotiated!");
|
||||
return GST_FLOW_NOT_NEGOTIATED;
|
||||
}
|
||||
}
|
||||
|
||||
taglist = gst_tag_list_new_empty ();
|
||||
gst_pb_utils_add_codec_description_to_tag_list (taglist,
|
||||
GST_TAG_AUDIO_CODEC, caps);
|
||||
gst_caps_unref (caps);
|
||||
|
|
|
@ -786,10 +786,19 @@ gst_ac3_parse_pre_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame)
|
|||
GstTagList *taglist;
|
||||
GstCaps *caps;
|
||||
|
||||
taglist = gst_tag_list_new_empty ();
|
||||
|
||||
/* codec tag */
|
||||
caps = gst_pad_get_current_caps (GST_BASE_PARSE_SRC_PAD (parse));
|
||||
if (G_UNLIKELY (caps == NULL)) {
|
||||
if (GST_PAD_IS_FLUSHING (GST_BASE_PARSE_SRC_PAD (parse))) {
|
||||
GST_INFO_OBJECT (parse, "Src pad is flushing");
|
||||
return GST_FLOW_FLUSHING;
|
||||
} else {
|
||||
GST_INFO_OBJECT (parse, "Src pad is not negotiated!");
|
||||
return GST_FLOW_NOT_NEGOTIATED;
|
||||
}
|
||||
}
|
||||
|
||||
taglist = gst_tag_list_new_empty ();
|
||||
gst_pb_utils_add_codec_description_to_tag_list (taglist,
|
||||
GST_TAG_AUDIO_CODEC, caps);
|
||||
gst_caps_unref (caps);
|
||||
|
|
|
@ -426,10 +426,19 @@ gst_amr_parse_pre_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame)
|
|||
GstTagList *taglist;
|
||||
GstCaps *caps;
|
||||
|
||||
taglist = gst_tag_list_new_empty ();
|
||||
|
||||
/* codec tag */
|
||||
caps = gst_pad_get_current_caps (GST_BASE_PARSE_SRC_PAD (parse));
|
||||
if (G_UNLIKELY (caps == NULL)) {
|
||||
if (GST_PAD_IS_FLUSHING (GST_BASE_PARSE_SRC_PAD (parse))) {
|
||||
GST_INFO_OBJECT (parse, "Src pad is flushing");
|
||||
return GST_FLOW_FLUSHING;
|
||||
} else {
|
||||
GST_INFO_OBJECT (parse, "Src pad is not negotiated!");
|
||||
return GST_FLOW_NOT_NEGOTIATED;
|
||||
}
|
||||
}
|
||||
|
||||
taglist = gst_tag_list_new_empty ();
|
||||
gst_pb_utils_add_codec_description_to_tag_list (taglist,
|
||||
GST_TAG_AUDIO_CODEC, caps);
|
||||
gst_caps_unref (caps);
|
||||
|
|
|
@ -565,10 +565,19 @@ gst_dca_parse_pre_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame)
|
|||
GstTagList *taglist;
|
||||
GstCaps *caps;
|
||||
|
||||
taglist = gst_tag_list_new_empty ();
|
||||
|
||||
/* codec tag */
|
||||
caps = gst_pad_get_current_caps (GST_BASE_PARSE_SRC_PAD (parse));
|
||||
if (G_UNLIKELY (caps == NULL)) {
|
||||
if (GST_PAD_IS_FLUSHING (GST_BASE_PARSE_SRC_PAD (parse))) {
|
||||
GST_INFO_OBJECT (parse, "Src pad is flushing");
|
||||
return GST_FLOW_FLUSHING;
|
||||
} else {
|
||||
GST_INFO_OBJECT (parse, "Src pad is not negotiated!");
|
||||
return GST_FLOW_NOT_NEGOTIATED;
|
||||
}
|
||||
}
|
||||
|
||||
taglist = gst_tag_list_new_empty ();
|
||||
gst_pb_utils_add_codec_description_to_tag_list (taglist,
|
||||
GST_TAG_AUDIO_CODEC, caps);
|
||||
gst_caps_unref (caps);
|
||||
|
|
|
@ -1708,6 +1708,15 @@ gst_flac_parse_pre_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame)
|
|||
|
||||
/* codec tag */
|
||||
caps = gst_pad_get_current_caps (GST_BASE_PARSE_SRC_PAD (parse));
|
||||
if (G_UNLIKELY (caps == NULL)) {
|
||||
if (GST_PAD_IS_FLUSHING (GST_BASE_PARSE_SRC_PAD (parse))) {
|
||||
GST_INFO_OBJECT (parse, "Src pad is flushing");
|
||||
return GST_FLOW_FLUSHING;
|
||||
} else {
|
||||
GST_INFO_OBJECT (parse, "Src pad is not negotiated!");
|
||||
return GST_FLOW_NOT_NEGOTIATED;
|
||||
}
|
||||
}
|
||||
gst_pb_utils_add_codec_description_to_tag_list (flacparse->tags,
|
||||
GST_TAG_AUDIO_CODEC, caps);
|
||||
gst_caps_unref (caps);
|
||||
|
|
|
@ -1361,6 +1361,17 @@ gst_mpeg_audio_parse_pre_push_frame (GstBaseParse * parse,
|
|||
|
||||
/* codec tag */
|
||||
caps = gst_pad_get_current_caps (GST_BASE_PARSE_SRC_PAD (parse));
|
||||
if (G_UNLIKELY (caps == NULL)) {
|
||||
gst_tag_list_unref (taglist);
|
||||
|
||||
if (GST_PAD_IS_FLUSHING (GST_BASE_PARSE_SRC_PAD (parse))) {
|
||||
GST_INFO_OBJECT (parse, "Src pad is flushing");
|
||||
return GST_FLOW_FLUSHING;
|
||||
} else {
|
||||
GST_INFO_OBJECT (parse, "Src pad is not negotiated!");
|
||||
return GST_FLOW_NOT_NEGOTIATED;
|
||||
}
|
||||
}
|
||||
gst_pb_utils_add_codec_description_to_tag_list (taglist,
|
||||
GST_TAG_AUDIO_CODEC, caps);
|
||||
gst_caps_unref (caps);
|
||||
|
|
|
@ -507,10 +507,19 @@ gst_sbc_parse_pre_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame)
|
|||
GstTagList *taglist;
|
||||
GstCaps *caps;
|
||||
|
||||
taglist = gst_tag_list_new_empty ();
|
||||
|
||||
/* codec tag */
|
||||
caps = gst_pad_get_current_caps (GST_BASE_PARSE_SRC_PAD (parse));
|
||||
if (G_UNLIKELY (caps == NULL)) {
|
||||
if (GST_PAD_IS_FLUSHING (GST_BASE_PARSE_SRC_PAD (parse))) {
|
||||
GST_INFO_OBJECT (parse, "Src pad is flushing");
|
||||
return GST_FLOW_FLUSHING;
|
||||
} else {
|
||||
GST_INFO_OBJECT (parse, "Src pad is not negotiated!");
|
||||
return GST_FLOW_NOT_NEGOTIATED;
|
||||
}
|
||||
}
|
||||
|
||||
taglist = gst_tag_list_new_empty ();
|
||||
gst_pb_utils_add_codec_description_to_tag_list (taglist,
|
||||
GST_TAG_AUDIO_CODEC, caps);
|
||||
gst_caps_unref (caps);
|
||||
|
|
|
@ -680,10 +680,19 @@ gst_wavpack_parse_pre_push_frame (GstBaseParse * parse,
|
|||
GstTagList *taglist;
|
||||
GstCaps *caps;
|
||||
|
||||
taglist = gst_tag_list_new_empty ();
|
||||
|
||||
/* codec tag */
|
||||
caps = gst_pad_get_current_caps (GST_BASE_PARSE_SRC_PAD (parse));
|
||||
if (G_UNLIKELY (caps == NULL)) {
|
||||
if (GST_PAD_IS_FLUSHING (GST_BASE_PARSE_SRC_PAD (parse))) {
|
||||
GST_INFO_OBJECT (parse, "Src pad is flushing");
|
||||
return GST_FLOW_FLUSHING;
|
||||
} else {
|
||||
GST_INFO_OBJECT (parse, "Src pad is not negotiated!");
|
||||
return GST_FLOW_NOT_NEGOTIATED;
|
||||
}
|
||||
}
|
||||
|
||||
taglist = gst_tag_list_new_empty ();
|
||||
gst_pb_utils_add_codec_description_to_tag_list (taglist,
|
||||
GST_TAG_AUDIO_CODEC, caps);
|
||||
gst_caps_unref (caps);
|
||||
|
|
Loading…
Reference in a new issue