summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjosh.macdonald <jmacd@users.noreply.github.com>2006-12-10 20:44:36 +0000
committerjosh.macdonald <jmacd@users.noreply.github.com>2006-12-10 20:44:36 +0000
commit6674bf7d106d2ec20bdbe12cb95370b8666a1cfb (patch)
tree27cb8c0bd1a23b576b95089a31a32f16299fbde0
parent811bb03103a6e8a307c2e59863f03dd88cd9b11c (diff)
Stack corruption errors: added some room to the arrays.
-rwxr-xr-xxdelta3/xdelta3-djw.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/xdelta3/xdelta3-djw.h b/xdelta3/xdelta3-djw.h
index a021907..7479895 100755
--- a/xdelta3/xdelta3-djw.h
+++ b/xdelta3/xdelta3-djw.h
@@ -897,8 +897,8 @@ xd3_real_encode_huff (xd3_stream *stream,
897 usize_t select_bits; 897 usize_t select_bits;
898 usize_t sym1 = 0, sym2 = 0, s; 898 usize_t sym1 = 0, sym2 = 0, s;
899 usize_t gcost[DJW_MAX_GROUPS]; 899 usize_t gcost[DJW_MAX_GROUPS];
900 uint gbest_code[DJW_MAX_GROUPS+1]; 900 uint gbest_code[DJW_MAX_GROUPS+2];
901 uint8_t gbest_clen[DJW_MAX_GROUPS+1]; 901 uint8_t gbest_clen[DJW_MAX_GROUPS+2];
902 usize_t gbest_max = 1 + (input_bytes - 1) / sector_size; 902 usize_t gbest_max = 1 + (input_bytes - 1) / sector_size;
903 int best_bits = 0; 903 int best_bits = 0;
904 usize_t gbest_no; 904 usize_t gbest_no;
@@ -1231,8 +1231,8 @@ djw_build_decoder (xd3_stream *stream,
1231{ 1231{
1232 int i, l; 1232 int i, l;
1233 const uint8_t *ci; 1233 const uint8_t *ci;
1234 uint nr_clen [DJW_MAX_CODELEN+1]; 1234 uint nr_clen [DJW_MAX_CODELEN+2];
1235 uint tmp_base[DJW_MAX_CODELEN+1]; 1235 uint tmp_base[DJW_MAX_CODELEN+2];
1236 int min_clen; 1236 int min_clen;
1237 int max_clen; 1237 int max_clen;
1238 1238
@@ -1552,8 +1552,8 @@ xd3_decode_huff (xd3_stream *stream,
1552 /* Outer scope: per-group symbol decoder tables. */ 1552 /* Outer scope: per-group symbol decoder tables. */
1553 { 1553 {
1554 uint8_t inorder[DJW_MAX_GROUPS][ALPHABET_SIZE]; 1554 uint8_t inorder[DJW_MAX_GROUPS][ALPHABET_SIZE];
1555 uint base [DJW_MAX_GROUPS][DJW_MAX_CODELEN+1]; 1555 uint base [DJW_MAX_GROUPS][DJW_MAX_CODELEN+2];
1556 uint limit [DJW_MAX_GROUPS][DJW_MAX_CODELEN+1]; 1556 uint limit [DJW_MAX_GROUPS][DJW_MAX_CODELEN+2];
1557 uint minlen [DJW_MAX_GROUPS]; 1557 uint minlen [DJW_MAX_GROUPS];
1558 uint maxlen [DJW_MAX_GROUPS]; 1558 uint maxlen [DJW_MAX_GROUPS];
1559 1559
@@ -1561,8 +1561,8 @@ xd3_decode_huff (xd3_stream *stream,
1561 { 1561 {
1562 uint8_t clen [DJW_MAX_GROUPS][ALPHABET_SIZE]; 1562 uint8_t clen [DJW_MAX_GROUPS][ALPHABET_SIZE];
1563 uint8_t cl_inorder[DJW_TOTAL_CODES]; 1563 uint8_t cl_inorder[DJW_TOTAL_CODES];
1564 uint cl_base [DJW_MAX_CLCLEN+1]; 1564 uint cl_base [DJW_MAX_CLCLEN+2];
1565 uint cl_limit [DJW_MAX_CLCLEN+1]; 1565 uint cl_limit [DJW_MAX_CLCLEN+2];
1566 uint8_t cl_mtf [DJW_TOTAL_CODES]; 1566 uint8_t cl_mtf [DJW_TOTAL_CODES];
1567 uint cl_minlen; 1567 uint cl_minlen;
1568 uint cl_maxlen; 1568 uint cl_maxlen;
@@ -1589,10 +1589,10 @@ xd3_decode_huff (xd3_stream *stream,
1589 1589
1590 /* Decode: selector clens. */ 1590 /* Decode: selector clens. */
1591 { 1591 {
1592 uint8_t sel_inorder[DJW_MAX_GROUPS+1]; 1592 uint8_t sel_inorder[DJW_MAX_GROUPS+2];
1593 uint sel_base [DJW_MAX_GBCLEN+1]; 1593 uint sel_base [DJW_MAX_GBCLEN+2];
1594 uint sel_limit [DJW_MAX_GBCLEN+1]; 1594 uint sel_limit [DJW_MAX_GBCLEN+2];
1595 uint8_t sel_mtf [DJW_MAX_GROUPS+1]; 1595 uint8_t sel_mtf [DJW_MAX_GROUPS+2];
1596 uint sel_minlen; 1596 uint sel_minlen;
1597 uint sel_maxlen; 1597 uint sel_maxlen;
1598 1598