]> code.delx.au - pulseaudio/commit
resampler: Make sure that there are no overflows when multiplying potentially big...
authorTanu Kaskinen <tanuk@iki.fi>
Mon, 9 Jul 2012 07:07:05 +0000 (10:07 +0300)
committerTanu Kaskinen <tanuk@iki.fi>
Tue, 30 Oct 2012 14:21:35 +0000 (16:21 +0200)
commite4adf9c4d8a33509828b9b7658d4cccc7f5af563
tree8ac9172db7b91ecb91bcea5623738ee0f11aad0d
parent9bcb9f1a62bf25a24b97fc34aef55eca10202344
resampler: Make sure that there are no overflows when multiplying potentially big numbers.

This fixes at least one crash that has been observed. The
multiplication in trivial_resample() overflowed when
resampling from 96 kHz to 48 kHz, causing an assertion
error:

Assertion 'o_index * fz < pa_memblock_get_length(output->memblock)' failed at pulsecore/resampler.c:1521, function trivial_resample(). Aborting.

Without the assertion, the memcpy() after the assertion
would have overwritten some random heap memory.
src/pulsecore/resampler.c