bluetooth: Fix potential assertion failure if MTU changes

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.
This commit is contained in:
Mikel Astiz 2013-01-24 10:16:56 +01:00 committed by Tanu Kaskinen
parent 707af43daa
commit 132814f114

View file

@ -332,6 +332,11 @@ static void teardown_stream(struct userdata *u) {
u->read_smoother = NULL; 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"); pa_log_debug("Audio stream torn down");
} }