From: Vinson Lee Date: Thu, 10 Dec 2009 23:41:13 +0000 (-0800) Subject: progs/samples: Byte swap individual members of struct _rawImageRec. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1cf60c981091d7a46cb404fd607f85553c427761;p=mesa.git progs/samples: Byte swap individual members of struct _rawImageRec. --- diff --git a/progs/samples/rgbtoppm.c b/progs/samples/rgbtoppm.c index 56ca5b0efe9..dcb74228dff 100644 --- a/progs/samples/rgbtoppm.c +++ b/progs/samples/rgbtoppm.c @@ -93,7 +93,12 @@ static ImageRec *ImageOpen(char *fileName) fread(image, 1, 12, image->file); if (swapFlag) { - ConvertShort(&image->imagic, 6); + ConvertShort(&image->imagic, 1); + ConvertShort(&image->type, 1); + ConvertShort(&image->dim, 1); + ConvertShort(&image->xsize, 1); + ConvertShort(&image->ysize, 1); + ConvertShort(&image->zsize, 1); } image->tmp = (unsigned char *)malloc(image->xsize*256);