mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-28 03:00:35 +00:00
audioconvert: Error out if mapping input/output buffer failed
This commit is contained in:
parent
1e64800278
commit
52d7441942
1 changed files with 19 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue