comparison src/render/SDL_yuv_sw.c @ 5274:11bd1585efb5

The YV12 image isn't w*h*2, it's actually w*h + w*h/4 + w*h/4
author Sam Lantinga <slouken@libsdl.org>
date Sat, 12 Feb 2011 10:13:53 -0800
parents b530ef003506
children
comparison
equal deleted inserted replaced
5273:c5a04f3c3908 5274:11bd1585efb5
1125 || rect->h != swdata->h)) { 1125 || rect->h != swdata->h)) {
1126 SDL_SetError 1126 SDL_SetError
1127 ("YV12 and IYUV textures only support full surface updates"); 1127 ("YV12 and IYUV textures only support full surface updates");
1128 return -1; 1128 return -1;
1129 } 1129 }
1130 SDL_memcpy(swdata->pixels, pixels, swdata->h * swdata->w * 2); 1130 SDL_memcpy(swdata->pixels, pixels,
1131 (swdata->h * swdata->w) + (swdata->h * swdata->w) / 2);
1131 break; 1132 break;
1132 case SDL_PIXELFORMAT_YUY2: 1133 case SDL_PIXELFORMAT_YUY2:
1133 case SDL_PIXELFORMAT_UYVY: 1134 case SDL_PIXELFORMAT_UYVY:
1134 case SDL_PIXELFORMAT_YVYU: 1135 case SDL_PIXELFORMAT_YVYU:
1135 { 1136 {