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 a816810266,
"vo_gl: improve 10-bit YUV->RGB conversion accuracy slightly".
This commit is contained in:
wm4 2012-03-26 04:12:26 +02:00
parent 84b2c79c56
commit c161d31eed
1 changed files with 5 additions and 5 deletions

View File

@ -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];
}
}
}
}