summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarren Salt <linux@youmustbejoking.demon.co.uk>2009-10-10 12:12:07 +0100
committerDarren Salt <linux@youmustbejoking.demon.co.uk>2009-10-10 12:12:07 +0100
commitae9b5a75d9560ec5ce88f93e89efccdf64594100 (patch)
tree3a1c0efc5224e03f0bc57667ab7d6550d65f9872
parente29dc8e47e77c99bc8227bea05e2630d071b4084 (diff)
downloadxine-lib-ae9b5a75d9560ec5ce88f93e89efccdf64594100.tar.gz
xine-lib-ae9b5a75d9560ec5ce88f93e89efccdf64594100.tar.bz2
MOD reported zero-length workaround (avoids divide-by-0).
-rw-r--r--ChangeLog1
-rw-r--r--src/demuxers/demux_mod.c2
2 files changed, 3 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 84c51e994..7fa1dd398 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -19,6 +19,7 @@ xine-lib (1.1.17) 2009-??-??
* Add a user agent & protocol hack ("qthttp://...") to allow direct
viewing of Apple film trailers.
* Fixed int-to-float conversion in the JACK output plugin.
+ * Work around MOD files with reported length == 0.
xine-lib (1.1.16.3) 2009-04-03
* Security fixes:
diff --git a/src/demuxers/demux_mod.c b/src/demuxers/demux_mod.c
index 34b8ebabe..de3e29ca8 100644
--- a/src/demuxers/demux_mod.c
+++ b/src/demuxers/demux_mod.c
@@ -178,6 +178,8 @@ static int open_mod_file(demux_mod_t *this) {
this->copyright = strdup("");
this->mod_length = ModPlug_GetLength(this->mpfile);
+ if (this->mod_length < 1)
+ this->mod_length = 1; /* avoids -ve & div-by-0 */
return 1;
}