audio-resampler: Fix segfault when we can't output any frames
authorNirbheek Chauhan <nirbheek@centricular.com>
Fri, 12 Nov 2021 12:56:58 +0000 (18:26 +0530)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Fri, 12 Nov 2021 16:12:27 +0000 (16:12 +0000)
commit5d3009b7f8d65c600c27f828b159b4d4703ca915
tree32f09bb6dc6ddd5accd9e2f57228fb2d74d045be
parent41385ab6f7e2464d4b364e52a1a27334108b226b
audio-resampler: Fix segfault when we can't output any frames

Sometimes the resampler has enough space to store all the incoming
samples without outputting anything. When this happens,
gst_audio_resampler_get_out_frames() returns 0.

In that case, the resampler should consume samples and just return.
Otherwise, we get a segfault when gst_audio_resampler_resample() tries
to resample into a NULL 'out' pointer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1343>
subprojects/gst-plugins-base/gst-libs/gst/audio/audio-resampler.c