The YV12 image isn't w*h*2, it's actually w*h + w*h/4 + w*h/4
authorSam Lantinga <slouken@libsdl.org>
Sat, 12 Feb 2011 10:13:53 -0800
changeset 526911bd1585efb5
parent 5268 c5a04f3c3908
child 5270 7aba0406c273
The YV12 image isn't w*h*2, it's actually w*h + w*h/4 + w*h/4
src/render/SDL_yuv_sw.c
     1.1 --- a/src/render/SDL_yuv_sw.c	Sat Feb 12 08:17:58 2011 -0800
     1.2 +++ b/src/render/SDL_yuv_sw.c	Sat Feb 12 10:13:53 2011 -0800
     1.3 @@ -1127,7 +1127,8 @@
     1.4                  ("YV12 and IYUV textures only support full surface updates");
     1.5              return -1;
     1.6          }
     1.7 -        SDL_memcpy(swdata->pixels, pixels, swdata->h * swdata->w * 2);
     1.8 +        SDL_memcpy(swdata->pixels, pixels,
     1.9 +                   (swdata->h * swdata->w) + (swdata->h * swdata->w) / 2);
    1.10          break;
    1.11      case SDL_PIXELFORMAT_YUY2:
    1.12      case SDL_PIXELFORMAT_UYVY: