Commit 7986a8ed authored by Stefan Sauer's avatar Stefan Sauer

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
parent a32b25db
......@@ -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;
}
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