]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cap_ogg.c
fix support of odd heights in YUV conversion for video capture
[xonotic/darkplaces.git] / cap_ogg.c
index eef3f90d6e3503b5febb2172d58ca318915a6389..609947ca3d02a32fc6f23b7eff8daec98c18ef62 100644 (file)
--- a/cap_ogg.c
+++ b/cap_ogg.c
@@ -847,7 +847,7 @@ static void SCR_CaptureVideo_Ogg_ConvertFrame_BGRA_to_YUV(void)
                        b += 4;
                }
 
-               if((y & 1) == 0)
+               if ((y & 1) == 0 && y/2 < h/2) // if h is odd, this skips the last row
                {
                        for(b = cls.capturevideo.outbuffer + (h-2-y)*w*4, x = 0; x < w/2; ++x)
                        {