summaryrefslogtreecommitdiff
path: root/progs
diff options
context:
space:
mode:
authorVinson Lee <vlee@vmware.com>2009-12-10 15:41:13 -0800
committerVinson Lee <vlee@vmware.com>2009-12-10 15:41:13 -0800
commit1cf60c981091d7a46cb404fd607f85553c427761 (patch)
tree4bc6f9321eff5e2a310f65a29de9bd4a6e2b4e10 /progs
parentbc0509bba8cc962a4ee2dafd684e153b3060262d (diff)
progs/samples: Byte swap individual members of struct _rawImageRec.
Diffstat (limited to 'progs')
-rw-r--r--progs/samples/rgbtoppm.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/progs/samples/rgbtoppm.c b/progs/samples/rgbtoppm.c
index 56ca5b0efe..dcb74228df 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);