summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sub/draw_bmp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sub/draw_bmp.c b/sub/draw_bmp.c
index 02b7f9ec20..041e0a70e0 100644
--- a/sub/draw_bmp.c
+++ b/sub/draw_bmp.c
@@ -296,7 +296,8 @@ static void draw_ass(struct mp_draw_sub_cache *cache, struct mp_rect bb,
cspar.int_bits_out = 8;
float yuv2rgb[3][4], rgb2yuv[3][4];
- if (temp->flags & MP_IMGFLAG_YUV) {
+ bool need_conv = temp->flags & MP_IMGFLAG_YUV;
+ if (need_conv) {
mp_get_yuv2rgb_coeffs(&cspar, yuv2rgb);
mp_invert_yuv2rgb(rgb2yuv, yuv2rgb);
}
@@ -314,10 +315,9 @@ static void draw_ass(struct mp_draw_sub_cache *cache, struct mp_rect bb,
int b = (sb->libass.color >> 8) & 0xFF;
int a = 255 - (sb->libass.color & 0xFF);
int color_yuv[3] = {r, g, b};
- if (dst.flags & MP_IMGFLAG_YUV) {
+ if (need_conv) {
mp_map_int_color(rgb2yuv, bits, color_yuv);
} else {
- assert(dst.imgfmt == IMGFMT_GBRP);
color_yuv[0] = g;
color_yuv[1] = b;
color_yuv[2] = r;