aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-11-14 22:27:04 +0100
committerMax Kellermann <max@duempel.org>2009-11-14 22:27:04 +0100
commitff70dbd316c12bf8c1edc140f0a73f0c53b81e43 (patch)
treee718964e59b69949274ab6c3dec5c0649229f9bb /src
parentdd4625ce13bfbd296f69bc9795561cfbfb63c210 (diff)
downloadmpd-ff70dbd316c12bf8c1edc140f0a73f0c53b81e43.tar.gz
mpd-ff70dbd316c12bf8c1edc140f0a73f0c53b81e43.tar.xz
mpd-ff70dbd316c12bf8c1edc140f0a73f0c53b81e43.zip
decoder/modplug: check ModPlug_Read() < 0
Negative return values are not documented here, but since the function prototype is signed, let's be sure.
Diffstat (limited to '')
-rw-r--r--src/decoder/modplug_plugin.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/decoder/modplug_plugin.c b/src/decoder/modplug_plugin.c
index 1d373a466..4c3302383 100644
--- a/src/decoder/modplug_plugin.c
+++ b/src/decoder/modplug_plugin.c
@@ -139,10 +139,8 @@ mod_decode(struct decoder *decoder, struct input_stream *is)
do {
ret = ModPlug_Read(f, audio_buffer, MODPLUG_FRAME_SIZE);
-
- if (ret == 0) {
+ if (ret <= 0)
break;
- }
total_time += ret * sec_perbyte;
cmd = decoder_data(decoder, NULL,