summaryrefslogtreecommitdiff
path: root/src/libFLAC/stream_decoder.c
diff options
context:
space:
mode:
authorErik de Castro Lopo <erikd@mega-nerd.com>2016-07-13 19:41:14 +1000
committerErik de Castro Lopo <erikd@mega-nerd.com>2016-07-13 19:42:25 +1000
commit74e751c421dfc578449906af3afa70489e5fb50b (patch)
tree7a056fa02a56e9015737e74b9d3889a754fb7f3f /src/libFLAC/stream_decoder.c
parent293acefe7795cb80394afc6ea50f6bb250130a73 (diff)
downloadflac-74e751c421dfc578449906af3afa70489e5fb50b.tar.gz
libFLAC: Set decoding status if write callback failed
Previously, it the write callback failed the error status would be set to `FLAC__STREAM_DECODER_READ_FRAME`. Now it gets set to `FLAC__STREAM_DECODER_WRITE_STATUS_ABORT`. Patch-from: lvqcl <lvqcl.mail@gmail.com>
Diffstat (limited to 'src/libFLAC/stream_decoder.c')
-rw-r--r--src/libFLAC/stream_decoder.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libFLAC/stream_decoder.c b/src/libFLAC/stream_decoder.c
index c3a903f9..91535ac5 100644
--- a/src/libFLAC/stream_decoder.c
+++ b/src/libFLAC/stream_decoder.c
@@ -2147,8 +2147,10 @@ FLAC__bool read_frame_(FLAC__StreamDecoder *decoder, FLAC__bool *got_a_frame, FL
/* write it */
if(do_full_decode) {
- if(write_audio_frame_to_client_(decoder, &decoder->private_->frame, (const FLAC__int32 * const *)decoder->private_->output) != FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE)
+ if(write_audio_frame_to_client_(decoder, &decoder->private_->frame, (const FLAC__int32 * const *)decoder->private_->output) != FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE) {
+ decoder->protected_->state = FLAC__STREAM_DECODER_ABORTED;
return false;
+ }
}
decoder->protected_->state = FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC;