summaryrefslogtreecommitdiffstats
path: root/sub/draw_bmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'sub/draw_bmp.c')
-rw-r--r--sub/draw_bmp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sub/draw_bmp.c b/sub/draw_bmp.c
index a4847b1534..0c913c86fd 100644
--- a/sub/draw_bmp.c
+++ b/sub/draw_bmp.c
@@ -148,10 +148,10 @@ static void unpremultiply_and_split_BGR32(struct mp_image *img,
uint8_t *arow = &alpha->planes[0][alpha->stride[0] * y];
for (int x = 0; x < img->w; ++x) {
uint32_t pval = irow[x];
- uint8_t aval = (pval >> 24);
- uint8_t rval = (pval >> 16) & 0xFF;
- uint8_t gval = (pval >> 8) & 0xFF;
- uint8_t bval = pval & 0xFF;
+ uint32_t aval = (pval >> 24);
+ uint32_t rval = (pval >> 16) & 0xFF;
+ uint32_t gval = (pval >> 8) & 0xFF;
+ uint32_t bval = pval & 0xFF;
// multiplied = separate * alpha / 255
// separate = rint(multiplied * 255 / alpha)
// = floor(multiplied * 255 / alpha + 0.5)