aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2011-12-13 20:08:31 +0100
committerMax Kellermann <max@duempel.org>2011-12-13 20:08:31 +0100
commit533e4fcdadf70cc2899f8e93a1aadfb219693a9c (patch)
tree1f7bd29fdf16ab9ed9b3dee01501ad7df845e5c8
parentf5d3859238538dba15d8a972594ad0a5a5f7edda (diff)
downloadmpd-533e4fcdadf70cc2899f8e93a1aadfb219693a9c.tar.gz
mpd-533e4fcdadf70cc2899f8e93a1aadfb219693a9c.tar.xz
mpd-533e4fcdadf70cc2899f8e93a1aadfb219693a9c.zip
decoder/mp4ff: work around assertion failure in read() callback
This workaround leads to an infinite loop instead of an assertion failure, but hey, now it's libmp4ff's fault.
-rw-r--r--src/decoder/mp4ff_decoder_plugin.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/decoder/mp4ff_decoder_plugin.c b/src/decoder/mp4ff_decoder_plugin.c
index 861b08194..cd85778f8 100644
--- a/src/decoder/mp4ff_decoder_plugin.c
+++ b/src/decoder/mp4ff_decoder_plugin.c
@@ -94,6 +94,12 @@ mp4_read(void *user_data, void *buffer, uint32_t length)
{
struct mp4ff_input_stream *mis = user_data;
+ if (length == 0)
+ /* libmp4ff is known to attempt to read 0 bytes - make
+ this a special case, because the input_stream API
+ would not allow this */
+ return 0;
+
return decoder_read(mis->decoder, mis->input_stream, buffer, length);
}