Re: [AD] Memory overrun in load_wav

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Thursday 24 November 2005 02:41 am, Chris Jones wrote:
> Then, the
> pack_fread call attempts to read in all "length" bytes which overruns the
> buffer and crashes the program.

It shouldn't read in "length" bytes. It should read "len*bits/8" bytes. 
Though, one could say having a 16-bit sound file with an odd number of bytes 
of data is a bad file. But  instead of letting it crash, it should probably 
just ignore the last byte, which can't be a valid 16-bit sample.




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/