Cristian Adam wrote:
Hi all,

I've made a test release for Ogg DirectShow Codecs.
You can find it here: http://www.xiph.org/dshow/uploads/Main/oggcodecs_0.80.15035.exe

The problem is that I get a HEAP Corruption detected at:

void FLAC__bitreader_free(FLAC__BitReader *br)
{
    FLAC__ASSERT(0 != br);

    if(0 != br->buffer)
        free(br->buffer);


The call stack is:

> libFLAC.dll!FLAC__bitreader_free(FLAC__BitReader * br=0x035280c0) Line 348 + 0xe bytes C libFLAC.dll!FLAC__stream_decoder_finish(FLAC__StreamDecoder * decoder=0x035265f0) Line 685 + 0xf bytes C libFLAC++.dll!FLAC::Decoder::Stream::~Stream() Line 56 + 0xf bytes C++ dsfNativeFLACSource.dll!NativeFLACSourceFilter::~NativeFLACSourceFilter() Line 83 + 0x4d bytes C++


I've updated the FLAC source code from 1.1.0 to 1.2.1, with an older package (oggcodecs_0.73.1936.exe),
but I want to deliver the new FLAC.

Any pointers?
Because the HEAP Corruption was only 8 bytes. So I've thought of giving more memory:

FLAC__bool FLAC__bitreader_init(FLAC__BitReader *br, FLAC__CPUInfo cpu, FLAC__BitReaderReadCallback rcb, void *cd)
{
   FLAC__ASSERT(0 != br);

   br->words = br->bytes = 0;
   br->consumed_words = br->consumed_bits = 0;
   br->capacity = FLAC__BITREADER_DEFAULT_CAPACITY;
br->buffer = (brword*)malloc(sizeof(brword) * (br->capacity + 2));

I remember seeing things like br->words = 2049 and br->capacity = 2048. This hack fixes the crashes, the updated setup file is here: http://www.xiph.org/dshow/uploads/Main/oggcodecs_0.80.15039.exe

Cheers,
Cristian.


_______________________________________________
Flac-dev mailing list
Flac-dev@xiph.org
http://lists.xiph.org/mailman/listinfo/flac-dev

Reply via email to