diff options
Diffstat (limited to '')
-rw-r--r-- | src/decoder_api.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/decoder_api.c b/src/decoder_api.c index 5f0425ce1..73b01533f 100644 --- a/src/decoder_api.c +++ b/src/decoder_api.c @@ -154,6 +154,7 @@ size_t decoder_read(struct decoder *decoder, { const struct decoder_control *dc = decoder != NULL ? decoder->dc : NULL; + GError *error = NULL; size_t nbytes; assert(decoder == NULL || @@ -176,7 +177,14 @@ size_t decoder_read(struct decoder *decoder, dc->command != DECODE_COMMAND_NONE) return 0; - nbytes = input_stream_read(is, buffer, length); + nbytes = input_stream_read(is, buffer, length, &error); + + if (G_UNLIKELY(nbytes == 0 && error != NULL)) { + g_warning("%s", error->message); + g_error_free(error); + return 0; + } + if (nbytes > 0 || input_stream_eof(is)) return nbytes; |