Commit cc75611f authored by Josh Coalson's avatar Josh Coalson
Browse files

fix valgrind uninitialized memory errors

parent 89f161c5
......@@ -398,7 +398,7 @@ public:
::OggFLAC__SeekableStreamEncoderReadStatus SeekableStreamEncoder::read_callback(FLAC__byte buffer[], unsigned *bytes)
{
(void)buffer, (void)bytes;
::memset(buffer, 0, *bytes); /* init buffer to avoid valgrind errors */
return ::OggFLAC__SEEKABLE_STREAM_ENCODER_READ_STATUS_CONTINUE;
}
......
......@@ -434,6 +434,7 @@ static FLAC__bool test_stream_encoder()
OggFLAC__SeekableStreamEncoderReadStatus seekable_stream_encoder_read_callback_(const OggFLAC__SeekableStreamEncoder *encoder, FLAC__byte buffer[], unsigned *bytes, void *client_data)
{
(void)encoder, (void)buffer, (void)bytes, (void)client_data;
memset(buffer, 0, *bytes); /* init buffer to avoid valgrind errors */
return OggFLAC__SEEKABLE_STREAM_ENCODER_READ_STATUS_CONTINUE;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment