Commit 52d74419 authored by Sebastian Dröge's avatar Sebastian Dröge

audioconvert: Error out if mapping input/output buffer failed

parent 1e648002
......@@ -732,12 +732,14 @@ gst_audio_convert_transform (GstBaseTransform * base, GstBuffer * inbuf,
&& gst_buffer_n_memory (inbuf) == 1
&& gst_memory_is_writable (gst_buffer_peek_memory (inbuf, 0));
gst_buffer_map (inbuf, &srcmap,
inbuf_writable ? GST_MAP_READWRITE : GST_MAP_READ);
if (!gst_buffer_map (inbuf, &srcmap,
inbuf_writable ? GST_MAP_READWRITE : GST_MAP_READ))
goto inmap_error;
} else {
inbuf_writable = TRUE;
}
gst_buffer_map (outbuf, &dstmap, GST_MAP_WRITE);
if (!gst_buffer_map (outbuf, &dstmap, GST_MAP_WRITE))
goto outmap_error;
/* check in and outsize */
if (inbuf != outbuf) {
......@@ -790,6 +792,20 @@ convert_error:
ret = GST_FLOW_ERROR;
goto done;
}
inmap_error:
{
GST_ELEMENT_ERROR (this, STREAM, FORMAT,
(NULL), ("failed to map input buffer"));
return GST_FLOW_ERROR;
}
outmap_error:
{
GST_ELEMENT_ERROR (this, STREAM, FORMAT,
(NULL), ("failed to map output buffer"));
if (inbuf != outbuf)
gst_buffer_unmap (inbuf, &srcmap);
return GST_FLOW_ERROR;
}
}
static GstFlowReturn
......
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