From 7855a3257980e45dec7cc57e998a5b4fa1504903 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 13 Feb 2012 18:05:42 +0100 Subject: pcm_buffer: pcm_buffer_get() never returns NULL This fixes a bug when libsamplerate returns an empty buffer for a very small input buffer. The caller thinks this is an error, bug there is no GError object. --- src/pcm_buffer.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/pcm_buffer.h') diff --git a/src/pcm_buffer.h b/src/pcm_buffer.h index fe223c742..b132d4fd2 100644 --- a/src/pcm_buffer.h +++ b/src/pcm_buffer.h @@ -63,6 +63,10 @@ pcm_buffer_deinit(struct pcm_buffer *buffer) /** * Get the buffer, and guarantee a minimum size. This buffer becomes * invalid with the next pcm_buffer_get() call. + * + * This function will never return NULL, even if size is zero, because + * the PCM library uses the NULL return value to signal "error". An + * empty destination buffer is not always an error. */ G_GNUC_MALLOC void * -- cgit v1.2.3