summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--spudec.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/spudec.c b/spudec.c
index f455e9ea01..d55ce28fa9 100644
--- a/spudec.c
+++ b/spudec.c
@@ -153,7 +153,11 @@ static void spudec_process_data(spudec_handle_t *this)
len = this->width - x;
/* FIXME have to use palette and alpha map*/
memset(this->image + y * this->width + x, cmap[color], len);
- memset(this->aimage + y * this->width + x, alpha[color], len);
+ if (alpha[color] < cmap[color]) {
+ memset(this->aimage + y * this->width + x, 1, len);
+ } else {
+ memset(this->aimage + y * this->width + x, alpha[color] - cmap[color], len);
+ }
x += len;
if (x >= this->width) {
next_line(this);