From c161d31eed3a66cbfb0207ffdc9b804c7e610770 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 26 Mar 2012 04:12:26 +0200 Subject: vo_direct3d: fix crash when using RGB formats The function mp_get_yuv2rgb_coeffs() expects valid values for input_bits. When using RGB formats, input_bits is outside the range of what mp_get_yuv2rgb_coeffs() expects. This doesn't matter since we don't use the result of that function in the RGB case, but it triggered an assertion. This is a regression from commit a8168102668337f3c1, "vo_gl: improve 10-bit YUV->RGB conversion accuracy slightly". --- libvo/vo_direct3d.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'libvo') diff --git a/libvo/vo_direct3d.c b/libvo/vo_direct3d.c index b5b23415ce..cffe7f81d0 100644 --- a/libvo/vo_direct3d.c +++ b/libvo/vo_direct3d.c @@ -1337,12 +1337,12 @@ static void update_colorspace(d3d_priv *priv) csp.input_bits = 8; csp.texture_bits = 8; } - } - mp_get_yuv2rgb_coeffs(&csp, coeff); - for (int row = 0; row < 3; row++) { - for (int col = 0; col < 4; col++) { - priv->d3d_colormatrix.m[row][col] = coeff[row][col]; + mp_get_yuv2rgb_coeffs(&csp, coeff); + for (int row = 0; row < 3; row++) { + for (int col = 0; col < 4; col++) { + priv->d3d_colormatrix.m[row][col] = coeff[row][col]; + } } } } -- cgit v1.2.3