Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
The YV12 image isn't w*h*2, it's actually w*h + w*h/4 + w*h/4
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Feb 12, 2011
1 parent 6154479 commit 7d879f7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/render/SDL_yuv_sw.c
Expand Up @@ -1127,7 +1127,8 @@ SDL_SW_UpdateYUVTexture(SDL_SW_YUVTexture * swdata, const SDL_Rect * rect,
("YV12 and IYUV textures only support full surface updates");
return -1;
}
SDL_memcpy(swdata->pixels, pixels, swdata->h * swdata->w * 2);
SDL_memcpy(swdata->pixels, pixels,
(swdata->h * swdata->w) + (swdata->h * swdata->w) / 2);
break;
case SDL_PIXELFORMAT_YUY2:
case SDL_PIXELFORMAT_UYVY:
Expand Down

0 comments on commit 7d879f7

Please sign in to comment.