mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-29 05:01:23 +00:00
audio: don't deref NULL
gst_buffer_copy_region() can return NULL when the buffer meta-data is invalid. See https://bugzilla.gnome.org/show_bug.cgi?id=772200
This commit is contained in:
parent
a32b25db6a
commit
7986a8ed3d
1 changed files with 11 additions and 7 deletions
|
@ -224,14 +224,18 @@ gst_audio_buffer_clip (GstBuffer * buffer, const GstSegment * segment,
|
|||
gst_buffer_unref (buffer);
|
||||
|
||||
GST_DEBUG ("timestamp %" GST_TIME_FORMAT, GST_TIME_ARGS (timestamp));
|
||||
GST_BUFFER_TIMESTAMP (ret) = timestamp;
|
||||
if (ret) {
|
||||
GST_BUFFER_TIMESTAMP (ret) = timestamp;
|
||||
|
||||
if (change_duration)
|
||||
GST_BUFFER_DURATION (ret) = duration;
|
||||
if (change_offset)
|
||||
GST_BUFFER_OFFSET (ret) = offset;
|
||||
if (change_offset_end)
|
||||
GST_BUFFER_OFFSET_END (ret) = offset_end;
|
||||
if (change_duration)
|
||||
GST_BUFFER_DURATION (ret) = duration;
|
||||
if (change_offset)
|
||||
GST_BUFFER_OFFSET (ret) = offset;
|
||||
if (change_offset_end)
|
||||
GST_BUFFER_OFFSET_END (ret) = offset_end;
|
||||
} else {
|
||||
GST_ERROR ("copy_region failed");
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue