<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-2" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Cristian Adam wrote:
<blockquote cite="mid:4853B7CD.9040503@gmx.net" type="cite"><font
size="-1"><font face="Helvetica, Arial, sans-serif">Hi all,<br>
<br>
I've made a test release for Ogg DirectShow Codecs. <br>
You can find it here:
<a moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://www.xiph.org/dshow/uploads/Main/oggcodecs_0.80.15035.exe">http://www.xiph.org/dshow/uploads/Main/oggcodecs_0.80.15035.exe</a><br>
<br>
The problem is that I get a HEAP Corruption detected at:<br>
<small><br>
<big><font face="Courier New, Courier, monospace">void
FLAC__bitreader_free(FLAC__BitReader *br)<br>
{<br>
FLAC__ASSERT(0 != br);<br>
<br>
if(0 != br->buffer)<br>
</font></big></small><font color="#ff0000"
face="Courier New, Courier, monospace"> free(br->buffer);<br>
<br>
<br>
<font color="#000000" face="Helvetica, Arial, sans-serif">The call
stack is:<br>
<br>
<small><font face="Courier New, Courier, monospace">>
libFLAC.dll!FLAC__bitreader_free(FLAC__BitReader * br=0x035280c0) Line
348 + 0xe bytes C<br>
libFLAC.dll!FLAC__stream_decoder_finish(FLAC__StreamDecoder *
decoder=0x035265f0) Line 685 + 0xf bytes C<br>
libFLAC++.dll!FLAC::Decoder::Stream::~Stream() Line 56 + 0xf
bytes C++<br>
dsfNativeFLACSource.dll!NativeFLACSourceFilter::~NativeFLACSourceFilter()
Line 83 + 0x4d bytes C++<br>
</font></small><br>
<br>
I've updated the FLAC source code from 1.1.0 to 1.2.1, with an older
package (oggcodecs_0.73.1936.exe),<br>
but I want to deliver the new FLAC.<br>
<br>
Any pointers?<br>
</font></font></font></font></blockquote>
<small><font face="Helvetica, Arial, sans-serif">Because the HEAP
Corruption was only 8 bytes. So I've thought of giving more memory:</font></small><br>
<br>
<small><font face="Courier New, Courier, monospace">FLAC__bool
FLAC__bitreader_init(FLAC__BitReader *br, FLAC__CPUInfo cpu,
FLAC__BitReaderReadCallback rcb, void *cd)<br>
{<br>
FLAC__ASSERT(0 != br);<br>
<br>
br->words = br->bytes = 0;<br>
br->consumed_words = br->consumed_bits = 0;<br>
br->capacity = FLAC__BITREADER_DEFAULT_CAPACITY;<br>
<br>
<font color="#ff0000">br->buffer =
(brword*)malloc(sizeof(brword) * (br->capacity + 2));</font> <br>
</font></small><br>
<small><font face="Helvetica, Arial, sans-serif">I remember seeing
things like br->words = 2049 and br->capacity = 2048. This hack
fixes the crashes,<br>
the updated setup file is here: <big><a moz-do-not-send="true"
class="moz-txt-link-freetext"
href="http://www.xiph.org/dshow/uploads/Main/oggcodecs_0.80.15039.exe"><font
size="-1">http://www.xiph.org/dshow/uploads/Main/oggcodecs_0.80.15039.exe</font></a><br>
<small><br>
Cheers,<br>
Cristian.</small><br>
</big></font></small><br>
<br>
</body>
</html>