From 45e94a4e3640b74ceb28da94d7b867a0cab04fdb Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Sat, 5 Aug 2006 13:34:42 +0000 Subject: - avoid crashing when the FLAC file is broken CVS patchset: 8164 CVS date: 2006/08/05 13:34:42 --- src/libflac/decoder_flac.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/libflac/decoder_flac.c') diff --git a/src/libflac/decoder_flac.c b/src/libflac/decoder_flac.c index a568e27e3..b62286eaa 100644 --- a/src/libflac/decoder_flac.c +++ b/src/libflac/decoder_flac.c @@ -355,7 +355,10 @@ open_plugin (audio_decoder_class_t *class_gen, xine_stream_t *stream) { FLAC__stream_decoder_set_client_data (this->flac_decoder, this); - FLAC__stream_decoder_init (this->flac_decoder); + if (FLAC__stream_decoder_init (this->flac_decoder) == FLAC__STREAM_DECODER_SEARCH_FOR_METADATA) { + free (this); + return NULL; + } return (audio_decoder_t *) this; } -- cgit v1.2.3