[pulseaudio-discuss] [PATCH v0 2/3] bluetooth: Fix potential assertion failure if MTU changes

Tanu Kaskinen tanuk at iki.fi
Thu Jan 24 06:01:53 PST 2013


On Thu, 2013-01-24 at 10:16 +0100, Mikel Astiz wrote:
> From: Mikel Astiz <mikel.astiz at bmw-carit.de>
> 
> The assertion in hsp_process_render() assumes that, if a memory block is
> already set by the time the function is reached, its size matches
> write_block_size.
> 
> This can however fail if a transport has been released and acquired
> back, in the unlikely case where the MTU has changed in the meantime,
> assuming the memory block wasn't released.
> ---
>  src/modules/bluetooth/module-bluetooth-device.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c
> index 8d9c124..c153949 100644
> --- a/src/modules/bluetooth/module-bluetooth-device.c
> +++ b/src/modules/bluetooth/module-bluetooth-device.c
> @@ -332,6 +332,11 @@ static void teardown_stream(struct userdata *u) {
>          u->read_smoother = NULL;
>      }
>  
> +    if (u->write_memchunk.memblock) {
> +        pa_memblock_unref(u->write_memchunk.memblock);
> +        pa_memchunk_reset(&u->write_memchunk);
> +    }
> +
>      pa_log_debug("Audio stream torn down");
>  }
>  

Thanks, I've pushed this one.

-- 
Tanu



More information about the pulseaudio-discuss mailing list