mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 04:46:13 +00:00
Fix: don't try to mangle a read-only buffer. This was causing SEGV when volume fed from wavparse from filesrc (which...
Original commit message from CVS: patch from jim thornton <jthornton@parc.com>: Fix: don't try to mangle a read-only buffer. This was causing SEGV when volume fed from wavparse from filesrc (which mmaps the file read-only)
This commit is contained in:
parent
2d698ba7d2
commit
29487094cc
2 changed files with 5 additions and 1 deletions
2
common
2
common
|
@ -1 +1 @@
|
||||||
Subproject commit 38267abf56a3428093cea71429dca6a24a927547
|
Subproject commit 6148068f2318e85d8e66df485342b630d8fb49ac
|
|
@ -255,6 +255,9 @@ volume_chain (GstPad *pad, GstBuffer *buf)
|
||||||
g_return_if_fail(filter != NULL);
|
g_return_if_fail(filter != NULL);
|
||||||
g_return_if_fail(GST_IS_VOLUME(filter));
|
g_return_if_fail(GST_IS_VOLUME(filter));
|
||||||
|
|
||||||
|
if (GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_READONLY))
|
||||||
|
buf = gst_buffer_copy (buf);
|
||||||
|
|
||||||
switch (filter->format) {
|
switch (filter->format) {
|
||||||
case GST_VOLUME_FORMAT_INT:
|
case GST_VOLUME_FORMAT_INT:
|
||||||
int_data = (gint16 *)GST_BUFFER_DATA(buf);
|
int_data = (gint16 *)GST_BUFFER_DATA(buf);
|
||||||
|
@ -314,6 +317,7 @@ volume_set_property (GObject *object, guint prop_id, const GValue *value, GParam
|
||||||
filter->volume_i = filter->volume_f*8192;
|
filter->volume_i = filter->volume_f*8192;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue