summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2010-05-30 15:21:18 +0300
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-05-30 15:21:18 +0300
commit18657beb190b3e4acc6404c3b87e6eafbd22de3c (patch)
tree727383b945b8d0239b180200e3f6e2dfe1f10766 /libvo
parent1888e57af7e1ce51517ad9bdc2d201eaf84a98d2 (diff)
parent8d0afdaa88f855deafe97bd94656b300e31ada35 (diff)
downloadmpv-18657beb190b3e4acc6404c3b87e6eafbd22de3c.tar.bz2
mpv-18657beb190b3e4acc6404c3b87e6eafbd22de3c.tar.xz
Merge svn changes up to r31145
Diffstat (limited to 'libvo')
-rw-r--r--libvo/gl_common.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libvo/gl_common.c b/libvo/gl_common.c
index 800e5e6d7d..aa7beb7cf3 100644
--- a/libvo/gl_common.c
+++ b/libvo/gl_common.c
@@ -529,8 +529,11 @@ void glCreateClearTex(GLenum target, GLenum fmt, GLenum format, GLenum type, GLi
int w, int h, unsigned char val) {
GLfloat fval = (GLfloat)val / 255.0;
GLfloat border[4] = {fval, fval, fval, fval};
- int stride = w * glFmt2bpp(format, type);
+ int stride;
char *init;
+ if (w == 0) w = 1;
+ if (h == 0) h = 1;
+ stride = w * glFmt2bpp(format, type);
if (!stride) return;
init = malloc(stride * h);
memset(init, val, stride * h);
@@ -1422,6 +1425,8 @@ int glAutodetectYUVConversion(void) {
void glSetupYUVConversion(gl_conversion_params_t *params) {
float uvcos = params->csp_params.saturation * cos(params->csp_params.hue);
float uvsin = params->csp_params.saturation * sin(params->csp_params.hue);
+ if (params->chrom_texw == 0) params->chrom_texw = 1;
+ if (params->chrom_texh == 0) params->chrom_texh = 1;
switch (YUV_CONVERSION(params->type)) {
case YUV_CONVERSION_COMBINERS:
glSetupYUVCombiners(uvcos, uvsin);