summaryrefslogtreecommitdiff
path: root/src/libFLAC/stream_decoder.c
diff options
context:
space:
mode:
authorErik de Castro Lopo <erikd@mega-nerd.com>2015-07-13 22:15:58 +1000
committerErik de Castro Lopo <erikd@mega-nerd.com>2015-07-13 22:20:29 +1000
commit6ced857c253d5da286bf31adfd74a627aaa43c77 (patch)
treeaa5609b8d4af7e15050e5c69dbbf6b89127ba267 /src/libFLAC/stream_decoder.c
parentcf7442d638114899d8fec51d7d71ac2a9c24cca9 (diff)
downloadflac-6ced857c253d5da286bf31adfd74a627aaa43c77.tar.gz
libFLAC: Fix decoder_flush with uninitialized decoder
Closes: https://sourceforge.net/p/flac/bugs/428
Diffstat (limited to 'src/libFLAC/stream_decoder.c')
-rw-r--r--src/libFLAC/stream_decoder.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libFLAC/stream_decoder.c b/src/libFLAC/stream_decoder.c
index 231422c1..04ce7cdc 100644
--- a/src/libFLAC/stream_decoder.c
+++ b/src/libFLAC/stream_decoder.c
@@ -936,6 +936,9 @@ FLAC_API FLAC__bool FLAC__stream_decoder_flush(FLAC__StreamDecoder *decoder)
FLAC__ASSERT(0 != decoder->private_);
FLAC__ASSERT(0 != decoder->protected_);
+ if(!decoder->private_->internal_reset_hack && decoder->protected_->state == FLAC__STREAM_DECODER_UNINITIALIZED)
+ return false;
+
decoder->private_->samples_decoded = 0;
decoder->private_->do_md5_checking = false;