On Fri, May 1, 2009 at 11:58 PM, Reimar D?ffinger <Reimar.Doeffinger at gmx.de> wrote:
On Fri, May 01, 2009 at 07:39:37PM +0300, Kostya wrote:
On Fri, May 01, 2009 at 06:08:37PM +0200, Laurent Aimar wrote:
I'd use s->crc_extra = AV_RL32(buf) and open bit buffer after that but this looks fine too. Oh, and please add block size check. ?Using the bitstream reader here seems simpler to me, and additionnaly avoid the need of buffer size checks ;)
It's not - if size <=4 (as WavPack source code says), it should be treated as error, so check is needed anyway (not for bits reading though).
Huh? Where does that idea that using the bitstream reader means you can skip the size checks come from? Is that why ALAC is so horribly broken in that regard?
Very likely. All input is done *solely* using get_bits, so adding checks requires some hacks. -- Regards, Jai