[alsa-devel] [PATCH v5] ASoC: Apply msbits constraint for sample size bigger than the msbits

Peter Ujfalusi peter.ujfalusi at ti.com
Wed Jan 18 16:43:36 CET 2012


On 01/18/2012 04:35 PM, Clemens Ladisch wrote:
> Peter Ujfalusi wrote:
>> We run the loop as long as the sample size is bigger than the requested
>> msbits.
> 
>> +	while (sample_sizes[i] > bits && i < ARRAY_SIZE(sample_sizes)) {
> 
> This will overrun sample_sizes[] if bits < 8.

which is prevented by the: && i < ARRAY_SIZE(sample_sizes)

-- 
Péter


More information about the Alsa-devel mailing list