[flac-dev] Crash when writing 32bit flac files, am I doing something wrong ?

Stéphane Damo stephane.damo at gmail.com
Thu Mar 22 00:41:31 UTC 2018


Hello,

I manage to successfully write 8, 16 and 24 bit, all stereo, FLAC files.
But when I try to write 32 bit FLACs my program crashes.

*FLAC__stream_encoder_set_bits_per_sample *is called to match the desired
bit depth (8, 16, 24, 32)

It's the same code for all bit depths, i provide a fixed-size signed int
buffer to the lib (size=16384), with values with appropriate ranges for
each bit depth (-128...+127 for 8 bit, etc.).

The crash happens in stream_encoder.c line 2263 :

*encoder->private_->integer_signal[channel][i] = buffer[k++];*

It happens when I call *FLAC__stream_encoder_process_interleaved**(encoder,
out, 16384/2)* in my code. Its working perfectly for all bit depth except
32 bit.


Output message: Unhandled exception at 0x00F98441 in fmcomposer.exe:
0xC0000005: Access violation writing location 0x00000000.


I'm using the latest code from the github repository. Reading the docs
didn't noticed any thing special to do for writing 32 bit FLACs, it seems
it should be supported. Maybe I am missing something ?



Regards

Stéphane
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xiph.org/pipermail/flac-dev/attachments/20180322/92206667/attachment.html>


More information about the flac-dev mailing list