From 6869431c2b6926980a9f0c52d1ba83ceb8a12010 Mon Sep 17 00:00:00 2001 From: Mickael B Date: Sat, 22 Jul 2017 03:56:01 -0400 Subject: [PATCH] fix variable initialization in loops --- libImaging/SgiRleDecode.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libImaging/SgiRleDecode.c b/libImaging/SgiRleDecode.c index f612691c0..9f8b4141a 100644 --- a/libImaging/SgiRleDecode.c +++ b/libImaging/SgiRleDecode.c @@ -54,7 +54,6 @@ int ImagingSgiRleDecode(Imaging im, ImagingCodecState state, UINT8* buf, int bytes) { - int n, depth; UINT8* ptr; ptr = buf; @@ -90,9 +89,11 @@ ImagingSgiRleDecode(Imaging im, ImagingCodecState state, readlongtab(&ptr, state->ysize * zsize, lengthtab); /* get scanlines informations */ - for (int rowno = 0; rowno < state->ysize; ++rowno) { + int rowno; + for (rowno = 0; rowno < state->ysize; ++rowno) { - for (int channo = 0; channo < zsize; ++channo) { + int channo; + for (channo = 0; channo < zsize; ++channo) { unsigned long rleoffset = starttab[rowno + channo * state->ysize]; @@ -115,7 +116,8 @@ ImagingSgiRleDecode(Imaging im, ImagingCodecState state, expandrow(scanline, rledata, 0); /* populate the state buffer */ - for (int x = 0; x < state->xsize; ++x) { + int x; + for (x = 0; x < state->xsize; ++x) { state->buffer[x * zsize + channo] = scanline[x]; }