rtp: Initialize adapter to NULL for early pipeline error

If gstreamer pipeline immediately returns error, adapter pointer would not be
initialized and pa_rtp_recv may crash calling gst_object_unref() on it.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/615>
This commit is contained in:
Igor V. Kovalenko 2021-08-06 22:42:48 +03:00
parent 49b07edcaf
commit 1a575bb0a7

View file

@ -595,7 +595,7 @@ fail:
int pa_rtp_recv(pa_rtp_context *c, pa_memchunk *chunk, pa_mempool *pool, uint32_t *rtp_tstamp, struct timeval *tstamp) { int pa_rtp_recv(pa_rtp_context *c, pa_memchunk *chunk, pa_mempool *pool, uint32_t *rtp_tstamp, struct timeval *tstamp) {
GstSample *sample = NULL; GstSample *sample = NULL;
GstBufferList *buf_list; GstBufferList *buf_list;
GstAdapter *adapter; GstAdapter *adapter = NULL;
GstBuffer *buf; GstBuffer *buf;
GstMapInfo info; GstMapInfo info;
GstClockTime timestamp = GST_CLOCK_TIME_NONE; GstClockTime timestamp = GST_CLOCK_TIME_NONE;