gpulib: limit height
authornotaz <notasas@gmail.com>
Fri, 4 Jan 2013 21:50:05 +0000 (23:50 +0200)
committernotaz <notasas@gmail.com>
Sat, 5 Jan 2013 02:54:38 +0000 (04:54 +0200)
plugins/gpulib/gpu.c

index 53fe0bc..337e27a 100644 (file)
@@ -68,10 +68,11 @@ static noinline void update_width(void)
 
 static noinline void update_height(void)
 {
+  // TODO: emulate this properly..
   int sh = gpu.screen.y2 - gpu.screen.y1;
   if (gpu.status.dheight)
     sh *= 2;
-  if (sh <= 0)
+  if (sh <= 0 || sh > gpu.screen.vres)
     sh = gpu.screen.vres;
 
   gpu.screen.h = sh;