summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authorwm4 <wm4@mplayer2.org>2012-03-26 04:12:26 +0200
committerwm4 <wm4@mplayer2.org>2012-03-26 04:12:26 +0200
commitc161d31eed3a66cbfb0207ffdc9b804c7e610770 (patch)
tree4223af76d6ab4f3074f93ef0c5b7ff3c1ffc5ca6 /libvo
parent84b2c79c56339eae64d5e5f622d8e65f463e5e1f (diff)
downloadmpv-c161d31eed3a66cbfb0207ffdc9b804c7e610770.tar.bz2
mpv-c161d31eed3a66cbfb0207ffdc9b804c7e610770.tar.xz
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".
Diffstat (limited to 'libvo')
-rw-r--r--libvo/vo_direct3d.c10
1 files changed, 5 insertions, 5 deletions
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];
+ }
}
}
}