Commit 328346ad authored by Dave Craig's avatar Dave Craig Committed by Sebastian Dröge

audioparsers: Check for NULL return value of gst_pad_get_current_caps()

https://bugzilla.gnome.org/show_bug.cgi?id=759503
parent bf74d37c
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment