From 93df7e0bf872c536bd7a3e239cc586e58728673e Mon Sep 17 00:00:00 2001 From: Josh Coalson Date: Wed, 24 Jul 2002 06:08:37 +0000 Subject: [PATCH] fix bug #584595: infinite loop if ..._process*() called when decoder is ABORTED --- src/libFLAC/stream_decoder.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libFLAC/stream_decoder.c b/src/libFLAC/stream_decoder.c index 435b98d..a6b6966 100644 --- a/src/libFLAC/stream_decoder.c +++ b/src/libFLAC/stream_decoder.c @@ -560,6 +560,7 @@ FLAC__bool FLAC__stream_decoder_process_whole_stream(FLAC__StreamDecoder *decode return false; /* above function sets the status for us */ break; case FLAC__STREAM_DECODER_END_OF_STREAM: + case FLAC__STREAM_DECODER_ABORTED: return true; default: FLAC__ASSERT(0); @@ -592,10 +593,9 @@ FLAC__bool FLAC__stream_decoder_process_metadata(FLAC__StreamDecoder *decoder) return false; /* above function sets the status for us */ break; case FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC: - return true; case FLAC__STREAM_DECODER_READ_FRAME: - return true; case FLAC__STREAM_DECODER_END_OF_STREAM: + case FLAC__STREAM_DECODER_ABORTED: return true; default: FLAC__ASSERT(0); @@ -626,6 +626,7 @@ FLAC__bool FLAC__stream_decoder_process_one_frame(FLAC__StreamDecoder *decoder) return true; /* above function sets the status for us */ break; case FLAC__STREAM_DECODER_END_OF_STREAM: + case FLAC__STREAM_DECODER_ABORTED: return true; default: FLAC__ASSERT(0); @@ -654,6 +655,7 @@ FLAC__bool FLAC__stream_decoder_process_remaining_frames(FLAC__StreamDecoder *de return false; /* above function sets the status for us */ break; case FLAC__STREAM_DECODER_END_OF_STREAM: + case FLAC__STREAM_DECODER_ABORTED: return true; default: FLAC__ASSERT(0); -- 2.7.4