summaryrefslogtreecommitdiffstats
path: root/progs
diff options
context:
space:
mode:
Diffstat (limited to 'progs')
-rw-r--r--progs/samples/rgbtoppm.c7
-rw-r--r--progs/util/readtex.c7
2 files changed, 12 insertions, 2 deletions
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);
diff --git a/progs/util/readtex.c b/progs/util/readtex.c
index 81cb626e911..d1c50a494aa 100644
--- a/progs/util/readtex.c
+++ b/progs/util/readtex.c
@@ -117,7 +117,12 @@ static rawImageRec *RawImageOpen(const char *fileName)
fread(raw, 1, 12, raw->file);
if (swapFlag) {
- ConvertShort(&raw->imagic, 6);
+ ConvertShort(&raw->imagic, 1);
+ ConvertShort(&raw->type, 1);
+ ConvertShort(&raw->dim, 1);
+ ConvertShort(&raw->sizeX, 1);
+ ConvertShort(&raw->sizeY, 1);
+ ConvertShort(&raw->sizeZ, 1);
}
raw->tmp = (unsigned char *)malloc(raw->sizeX*256);