summaryrefslogtreecommitdiff
path: root/src/demuxers/demux_mod.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/demuxers/demux_mod.c')
-rw-r--r--src/demuxers/demux_mod.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/demuxers/demux_mod.c b/src/demuxers/demux_mod.c
index cd55f6781..64d5b3856 100644
--- a/src/demuxers/demux_mod.c
+++ b/src/demuxers/demux_mod.c
@@ -175,6 +175,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;
}