--- SDL-1.2.9/src/video/quartz/SDL_QuartzYUV.m 2004-01-04 15:55:35.000000000 +0100 +++ SDL-1.2.9-jc/src/video/quartz/SDL_QuartzYUV.m 2006-09-10 11:37:41.000000000 +0200 @@ -273,6 +273,8 @@ return NULL; } + /* Fix: jc.bertin@free.fr + PlanarPixmapInfoYUV420 is a big-endian struct */ yuv_pixmap = (PlanarPixmapInfoYUV420*) malloc (sizeof(PlanarPixmapInfoYUV420) + (width * height * 2)); @@ -290,20 +292,20 @@ /* CHECK_ALIGN(pixels[0]); */ pitches[0] = width; - yuv_pixmap->componentInfoY.offset = offset; - yuv_pixmap->componentInfoY.rowBytes = width; + yuv_pixmap->componentInfoY.offset = EndianS32_NtoB(offset); + yuv_pixmap->componentInfoY.rowBytes = EndianU32_NtoB(width); offset += width * height; pixels[plane2] = (Uint8*)yuv_pixmap + offset; pitches[plane2] = width / 2; - yuv_pixmap->componentInfoCb.offset = offset; - yuv_pixmap->componentInfoCb.rowBytes = width / 2; + yuv_pixmap->componentInfoCb.offset = EndianS32_NtoB(offset); + yuv_pixmap->componentInfoCb.rowBytes = EndianU32_NtoB(width / 2); offset += (width * height / 4); pixels[plane3] = (Uint8*)yuv_pixmap + offset; pitches[plane3] = width / 2; - yuv_pixmap->componentInfoCr.offset = offset; - yuv_pixmap->componentInfoCr.rowBytes = width / 2; + yuv_pixmap->componentInfoCr.offset = EndianS32_NtoB(offset); + yuv_pixmap->componentInfoCr.rowBytes = EndianU32_NtoB(width / 2); overlay->pixels = pixels; overlay->pitches = pitches;