mirror of
https://github.com/mpv-player/mpv
synced 2024-12-27 01:22:30 +00:00
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:
parent
84b2c79c56
commit
c161d31eed
@ -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];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user