dbry / WavPack

WavPack encode/decode library, command-line programs, and several plugins

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Possible infinite loop in WavpackPackInit

hepoun opened this issue · comments

When WavpackContext is configured for zero channels (although it isn't a viable usecase) the WavpackPackInit() ends in infinite loop. I suspect the following code:

WavPack/src/pack_utils.c

Lines 519 to 520 in 22977b2

while (wpc->block_samples * wpc->config.num_channels < 20000)
wpc->block_samples *= 2;

(v5.1.0)

Thanks for pointing this out. I was already made aware of this and decided to fix it in the individual parsers instead of in the library. You can see those fixes here and here for example.

I agree that it should be checked for in the library and will do that before the next release, but I think it would be silly to backport this into previous versions because, unlike the decoder, the encoder would never be the default handler for any file type.

Thanks again!