summaryrefslogtreecommitdiff
path: root/plugins/gme
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2011-10-14 20:05:18 +0200
committerGravatar waker <wakeroid@gmail.com>2011-10-14 20:05:18 +0200
commiteff368834169ac8d72edf468da7bd72212770661 (patch)
tree0e3675a74b0400e1381bcc14f2d6eef4e30df8f4 /plugins/gme
parent497942072de6a38391114331ff403b85d994a7e1 (diff)
gme: couple of extra sanity checks in fadeout impl
Diffstat (limited to 'plugins/gme')
-rw-r--r--plugins/gme/cgme.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/gme/cgme.c b/plugins/gme/cgme.c
index 088f6dd2..6a28a878 100644
--- a/plugins/gme/cgme.c
+++ b/plugins/gme/cgme.c
@@ -199,7 +199,7 @@ cgme_read (DB_fileinfo_t *_info, char *bytes, int size) {
if (gme_play (info->emu, size/2, (short*)bytes)) {
return 0;
}
- if (info->reallength <= 0 && _info->readpos >= info->duration - conf_fadeout) {
+ if (conf_fadeout > 0 && info->duration >= conf_fadeout && info->reallength <= 0 && _info->readpos >= info->duration - conf_fadeout) {
float fade_amnt = (info->duration - _info->readpos) / (float)conf_fadeout;
int nsamples = size/2;
float fade_incr = 1.f / (_info->fmt.samplerate * conf_fadeout) * 256;