decoder/DecoderAPI: catch InputStream::Read() exceptions

This commit is contained in:
Max Kellermann 2016-09-16 17:34:48 +02:00
parent 687ea53616
commit 1bc553ea62

View File

@ -311,7 +311,7 @@ size_t
decoder_read(Decoder *decoder,
InputStream &is,
void *buffer, size_t length)
{
try {
/* XXX don't allow decoder==nullptr */
assert(decoder == nullptr ||
@ -345,6 +345,9 @@ decoder_read(Decoder *decoder,
LogError(error);
return nbytes;
} catch (const std::runtime_error &e) {
LogError(e);
return 0;
}
bool