Fix FLAC__stream_decoder_delete() and FLAC__stream_encoder_delete()

so that they will simply return if passed a NULL pointer (ie just
like the C free() stdlib function).
This commit is contained in:
Erik de Castro Lopo 2012-06-22 08:39:20 +10:00
parent 63c874f0fd
commit feab11e9bd
2 changed files with 6 additions and 2 deletions

View File

@ -332,7 +332,9 @@ FLAC_API void FLAC__stream_decoder_delete(FLAC__StreamDecoder *decoder)
{
unsigned i;
FLAC__ASSERT(0 != decoder);
if (decoder == NULL)
return ;
FLAC__ASSERT(0 != decoder->protected_);
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != decoder->private_->input);

View File

@ -578,7 +578,9 @@ FLAC_API void FLAC__stream_encoder_delete(FLAC__StreamEncoder *encoder)
{
unsigned i;
FLAC__ASSERT(0 != encoder);
if (encoder == NULL)
return ;
FLAC__ASSERT(0 != encoder->protected_);
FLAC__ASSERT(0 != encoder->private_);
FLAC__ASSERT(0 != encoder->private_->frame);