git-svn: trunk@3734
aCaB authored on 2008/03/21 12:19:36... | ... |
@@ -255,6 +255,7 @@ Bool unRLE_obuf_to_output_FAST ( DState* s ) |
255 | 255 |
UInt32 c_tPos = s->tPos; |
256 | 256 |
UChar* cs_next_out = s->strm->next_out; |
257 | 257 |
unsigned int cs_avail_out = s->strm->avail_out; |
258 |
+ Int32 ro_blockSize100k = s->blockSize100k; |
|
258 | 259 |
/* end restore */ |
259 | 260 |
|
260 | 261 |
UInt32 avail_out_INIT = cs_avail_out; |
... | ... |
@@ -422,13 +422,15 @@ typedef |
422 | 422 |
/*-- Macros for decompression. --*/ |
423 | 423 |
|
424 | 424 |
#define BZ_GET_FAST(cccc) \ |
425 |
- if (s->tPos >= s->blockSize100k * 100000) return True; \ |
|
425 |
+ /* c_tPos is unsigned, hence test < 0 is pointless. */ \ |
|
426 |
+ if (s->tPos >= (UInt32)100000 * (UInt32)s->blockSize100k) return True; \ |
|
426 | 427 |
s->tPos = s->tt[s->tPos]; \ |
427 | 428 |
cccc = (UChar)(s->tPos & 0xff); \ |
428 | 429 |
s->tPos >>= 8; |
429 | 430 |
|
430 | 431 |
#define BZ_GET_FAST_C(cccc) \ |
431 |
- if (c_tPos >= s->blockSize100k * 100000) return True; \ |
|
432 |
+ /* c_tPos is unsigned, hence test < 0 is pointless. */ \ |
|
433 |
+ if (c_tPos >= (UInt32)100000 * (UInt32)ro_blockSize100k) return True; \ |
|
432 | 434 |
c_tPos = c_tt[c_tPos]; \ |
433 | 435 |
cccc = (UChar)(c_tPos & 0xff); \ |
434 | 436 |
c_tPos >>= 8; |
... | ... |
@@ -451,6 +453,8 @@ typedef |
451 | 451 |
(((UInt32)s->ll16[i]) | (GET_LL4(i) << 16)) |
452 | 452 |
|
453 | 453 |
#define BZ_GET_SMALL(cccc) \ |
454 |
+ /* c_tPos is unsigned, hence test < 0 is pointless. */ \ |
|
455 |
+ if (s->tPos >= (UInt32)100000 * (UInt32)s->blockSize100k) return True; \ |
|
454 | 456 |
cccc = indexIntoF ( s->tPos, s->cftab ); \ |
455 | 457 |
s->tPos = GET_LL(s->tPos); |
456 | 458 |
|