diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2017-12-22 04:45:35 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2017-12-22 04:45:35 +0000 |
commit | 654a4a3d7e606b35fc8ea690adc28d20cc26ab46 (patch) | |
tree | 6f2927aa6d9b74826661e060728923945282935e /Build | |
parent | 204e8f2d99d5bb8c6b5a2514d2c95f2f26092e5d (diff) |
xetexdir/image/jpegimage.c: if j_info->xdpi and j_info->ydpi are not determined, they are assumed to be 72.0 to avoid division by 0.
git-svn-id: svn://tug.org/texlive/trunk@46118 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r-- | Build/source/texk/web2c/xetexdir/ChangeLog | 6 | ||||
-rw-r--r-- | Build/source/texk/web2c/xetexdir/image/jpegimage.c | 12 |
2 files changed, 16 insertions, 2 deletions
diff --git a/Build/source/texk/web2c/xetexdir/ChangeLog b/Build/source/texk/web2c/xetexdir/ChangeLog index 8cfc5544af1..3735780dd19 100644 --- a/Build/source/texk/web2c/xetexdir/ChangeLog +++ b/Build/source/texk/web2c/xetexdir/ChangeLog @@ -1,3 +1,9 @@ +2017-12-22 Akira Kakuto <kakuto@fuk.kindai.ac.jp> + + * image/jpegimage.c: If j_info->xdpi and j_info->ydpi are not + determined in some JPEG format, they are assumed to be 72.0 + in order to avoid division by zero. + 2017-11-07 Jonathan Kew <jfkthame@gmail.com> * XeTeX_ext.c: Guard against out-of-range result from UTF-8 diff --git a/Build/source/texk/web2c/xetexdir/image/jpegimage.c b/Build/source/texk/web2c/xetexdir/image/jpegimage.c index 643eae6b9fa..6b43fae194c 100644 --- a/Build/source/texk/web2c/xetexdir/image/jpegimage.c +++ b/Build/source/texk/web2c/xetexdir/image/jpegimage.c @@ -1,6 +1,6 @@ /****************************************************************************\ Part of the XeTeX typesetting system - Copyright (c) 1994-2009 by SIL International + Copyright (c) 1994-2017 by SIL International SIL Author(s): Jonathan Kew @@ -24,7 +24,7 @@ /* This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - Copyright (C) 2002-2015 by Jin-Hwan Cho and Shunsaku Hirata, + Copyright (C) 2002-2017 by Jin-Hwan Cho and Shunsaku Hirata, the dvipdfmx project team. Copyright (C) 1998, 1999 by Mark A. Wicks <mwicks@kettering.edu> @@ -492,5 +492,13 @@ JPEG_scan_file (struct JPEG_info *j_info, FILE *fp) count++; } +/* + * If j_info->xdpi, and j_info->ydpi are not yet determined, + * they are assumed to be 72.0 to avoid division by zero. + */ + if (j_info->xdpi < 0.1 && j_info->ydpi < 0.1) { + j_info->xdpi = j_info->ydpi = 72.0; + } + return (found_SOFn ? 0 : -1); } |