Commit 28ec3d7
Philip Oakley
zlib.c: refactor stream chuncking to fit uLong 32bit counting
On Windows uLong and size_t are different, being 32bit and 64bit
respectively. Computations of mixed 32/64 bit types can be
implementation defined leading to potential accuracy loss and error.
Avoid wraparound of z.total_in and z.total_in by always
starting at zero. The chunk size is kept well within 32bit limits.
Ensure the z.total_in and z.total_in are _upcast_ when computing the
overall avail_in and avail_out values
Signed-off-by: Philip Oakley <philipoakley@iee.org>1 parent 8d28694 commit 28ec3d7
1 file changed
+6
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | | - | |
| 41 | + | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
| 49 | + | |
| 50 | + | |
61 | 51 | | |
62 | 52 | | |
63 | | - | |
64 | | - | |
| 53 | + | |
| 54 | + | |
65 | 55 | | |
66 | 56 | | |
67 | 57 | | |
| |||
0 commit comments