diff options
author | wm4 <wm4@nowhere> | 2013-03-28 20:35:36 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-03-28 21:46:17 +0100 |
commit | f6a68063ba0e59a214d3d17d75f9005de14f5eb0 (patch) | |
tree | a75974f2975efb4988db8ca48f13f9fe075cf89b /sub/draw_bmp.c | |
parent | 6ef06aa145067b816aaf3b941aba11e36bfca545 (diff) | |
download | mpv-f6a68063ba0e59a214d3d17d75f9005de14f5eb0.tar.bz2 mpv-f6a68063ba0e59a214d3d17d75f9005de14f5eb0.tar.xz |
sub: don't crash on GBRP video
mp_get_yuv2rgb_coeffs() will crash if the colorspace is explicitly set
to RGB.
Diffstat (limited to 'sub/draw_bmp.c')
-rw-r--r-- | sub/draw_bmp.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sub/draw_bmp.c b/sub/draw_bmp.c index 09068dba89..4057500f01 100644 --- a/sub/draw_bmp.c +++ b/sub/draw_bmp.c @@ -287,8 +287,10 @@ 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]; - mp_get_yuv2rgb_coeffs(&cspar, yuv2rgb); - mp_invert_yuv2rgb(rgb2yuv, yuv2rgb); + if (temp->flags & MP_IMGFLAG_YUV) { + mp_get_yuv2rgb_coeffs(&cspar, yuv2rgb); + mp_invert_yuv2rgb(rgb2yuv, yuv2rgb); + } for (int i = 0; i < sbs->num_parts; ++i) { struct sub_bitmap *sb = &sbs->parts[i]; |