[Flac-dev] Bug in FLAC++ Stream::set_metadata()

John W. Terrell john-flacdev at coolpeople.us
Sat Dec 23 22:52:04 PST 2006

I've found what looks like a bug in FLAC++ inside the Stream::set_metadata() method.  It appears that the contained calls to FLAC__stream_encoder_set_metadata() are being passed arguments that point to local stack data (specifically the 'm' parameter which is a table that points to metadata objects).   The code inside FLAC__stream_encoder_set_metadata() does nothing but store the given args ('m' and 'num_blocks').   When Stream::set_metadata() exits, those stack objects go out of scope (or alternatively in the MSVC case, they're explicitly deleted).   Later inside the encoder's init() function, those destroyed data members are accessed and causes a fault.

I'm new to the mailing list so if this is a known issue, forgive me.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xiph.org/pipermail/flac-dev/attachments/20061223/34da76fd/attachment.html

More information about the Flac-dev mailing list