From c49dede77219b788077ddb2344496b74b8fd111b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 17 Dec 2012 15:17:12 +0100 Subject: [PATCH] audioparsers: Make sure the caps are actually writable before changing them --- gst/audioparsers/gstaacparse.c | 1 + gst/audioparsers/gstac3parse.c | 1 + gst/audioparsers/gstamrparse.c | 1 + gst/audioparsers/gstdcaparse.c | 1 + gst/audioparsers/gstflacparse.c | 1 + gst/audioparsers/gstmpegaudioparse.c | 1 + gst/audioparsers/gstwavpackparse.c | 1 + 7 files changed, 7 insertions(+) diff --git a/gst/audioparsers/gstaacparse.c b/gst/audioparsers/gstaacparse.c index 322e94a631..8f63b116e1 100644 --- a/gst/audioparsers/gstaacparse.c +++ b/gst/audioparsers/gstaacparse.c @@ -1115,6 +1115,7 @@ gst_aac_parse_sink_getcaps (GstBaseParse * parse, GstCaps * filter) res = gst_caps_intersect_full (peercaps, templ, GST_CAPS_INTERSECT_FIRST); gst_caps_unref (peercaps); + res = gst_caps_make_writable (res); /* Append the template caps because we still want to accept * caps without any fields in the case upstream does not diff --git a/gst/audioparsers/gstac3parse.c b/gst/audioparsers/gstac3parse.c index b9bc96e4d9..853ffc5511 100644 --- a/gst/audioparsers/gstac3parse.c +++ b/gst/audioparsers/gstac3parse.c @@ -715,6 +715,7 @@ gst_ac3_parse_get_sink_caps (GstBaseParse * parse, GstCaps * filter) res = gst_caps_intersect_full (peercaps, templ, GST_CAPS_INTERSECT_FIRST); gst_caps_unref (peercaps); + res = gst_caps_make_writable (res); /* Append the template caps because we still want to accept * caps without any fields in the case upstream does not diff --git a/gst/audioparsers/gstamrparse.c b/gst/audioparsers/gstamrparse.c index 39b68e00a2..1a321528dc 100644 --- a/gst/audioparsers/gstamrparse.c +++ b/gst/audioparsers/gstamrparse.c @@ -389,6 +389,7 @@ gst_amr_parse_sink_getcaps (GstBaseParse * parse, GstCaps * filter) res = gst_caps_intersect_full (peercaps, templ, GST_CAPS_INTERSECT_FIRST); gst_caps_unref (peercaps); + res = gst_caps_make_writable (res); /* Append the template caps because we still want to accept * caps without any fields in the case upstream does not * know anything. diff --git a/gst/audioparsers/gstdcaparse.c b/gst/audioparsers/gstdcaparse.c index 1ae0c03d7d..2abae88fd8 100644 --- a/gst/audioparsers/gstdcaparse.c +++ b/gst/audioparsers/gstdcaparse.c @@ -463,6 +463,7 @@ gst_dca_parse_get_sink_caps (GstBaseParse * parse, GstCaps * filter) res = gst_caps_intersect_full (peercaps, templ, GST_CAPS_INTERSECT_FIRST); gst_caps_unref (peercaps); + res = gst_caps_make_writable (res); /* Append the template caps because we still want to accept * caps without any fields in the case upstream does not diff --git a/gst/audioparsers/gstflacparse.c b/gst/audioparsers/gstflacparse.c index 154b749abd..777aeab44d 100644 --- a/gst/audioparsers/gstflacparse.c +++ b/gst/audioparsers/gstflacparse.c @@ -1757,6 +1757,7 @@ gst_flac_parse_get_sink_caps (GstBaseParse * parse, GstCaps * filter) res = gst_caps_intersect_full (peercaps, templ, GST_CAPS_INTERSECT_FIRST); gst_caps_unref (peercaps); + res = gst_caps_make_writable (res); /* Append the template caps because we still want to accept * caps without any fields in the case upstream does not diff --git a/gst/audioparsers/gstmpegaudioparse.c b/gst/audioparsers/gstmpegaudioparse.c index bbdf1993df..aaa9349435 100644 --- a/gst/audioparsers/gstmpegaudioparse.c +++ b/gst/audioparsers/gstmpegaudioparse.c @@ -1421,6 +1421,7 @@ gst_mpeg_audio_parse_get_sink_caps (GstBaseParse * parse, GstCaps * filter) res = gst_caps_intersect_full (peercaps, templ, GST_CAPS_INTERSECT_FIRST); gst_caps_unref (peercaps); + res = gst_caps_make_writable (res); /* Append the template caps because we still want to accept * caps without any fields in the case upstream does not diff --git a/gst/audioparsers/gstwavpackparse.c b/gst/audioparsers/gstwavpackparse.c index f0c0340f5d..8f124dd241 100644 --- a/gst/audioparsers/gstwavpackparse.c +++ b/gst/audioparsers/gstwavpackparse.c @@ -631,6 +631,7 @@ gst_wavpack_parse_get_sink_caps (GstBaseParse * parse, GstCaps * filter) res = gst_caps_intersect_full (peercaps, templ, GST_CAPS_INTERSECT_FIRST); gst_caps_unref (peercaps); + res = gst_caps_make_writable (res); /* Append the template caps because we still want to accept * caps without any fields in the case upstream does not