diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2012-02-01 15:06:57 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2012-02-01 15:06:57 +0000 |
commit | 0cce946c0c1b1ea96d7cafad585d90ef52bee170 (patch) | |
tree | 2d22fc60b2f376f11abe6d191102dab44a65f051 /Build/source/texk/web2c/mf.ch | |
parent | b527db88eb00d1921ad65e0eb1f6ed9b71033372 (diff) |
TeX, MF, and Co: Ensure DVI/GF file size <2GB
git-svn-id: svn://tug.org/texlive/trunk@25263 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/mf.ch')
-rw-r--r-- | Build/source/texk/web2c/mf.ch | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Build/source/texk/web2c/mf.ch b/Build/source/texk/web2c/mf.ch index e82053a1b41..f2b9a6d61a0 100644 --- a/Build/source/texk/web2c/mf.ch +++ b/Build/source/texk/web2c/mf.ch @@ -1942,6 +1942,38 @@ the bytes to be written in one shot. Much better than writing four bytes at a time. @z +@x [47.1155] check gf file size +each time, we use the macro |gf_out|. +@y +each time, we use the macro |gf_out|. + +The length of |gf_file| should not exceed |@"7FFFFFFF|; we set +|gf_prev_ptr:=0| to prevent further \.{GF} output causing infinite +recursion. +@z + +@x [47.1155] gf_swap: check gf file size +begin if gf_limit=gf_buf_size then +@y +begin if gf_ptr>(@"7FFFFFFF-gf_offset) then + begin gf_prev_ptr:=0; + fatal_error("gf length exceeds ""7FFFFFFF"); +@.gf length exceeds...@> + end; +if gf_limit=gf_buf_size then +@z + +@x [47.1156] empty the last bytes: check gf file size +if gf_ptr>0 then write_gf(0,gf_ptr-1) +@y +if gf_ptr>(@"7FFFFFFF-gf_offset) then + begin gf_prev_ptr:=0; + fatal_error("gf length exceeds ""7FFFFFFF"); +@.gf length exceeds...@> + end; +if gf_ptr>0 then write_gf(0,gf_ptr-1) +@z + @x [47.1163] C needs k to be 0..256 instead of 0..255. procedure init_gf; var @!k:eight_bits; {runs through all possible character codes} |